[Assorted-commits] SF.net SVN: assorted: [576] shell-tools/trunk/src/bash-commons/common.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-03-03 04:29:44
|
Revision: 576 http://assorted.svn.sourceforge.net/assorted/?rev=576&view=rev Author: yangzhang Date: 2008-03-02 20:29:50 -0800 (Sun, 02 Mar 2008) Log Message: ----------- added run-if-def Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2008-03-03 04:29:39 UTC (rev 575) +++ shell-tools/trunk/src/bash-commons/common.bash 2008-03-03 04:29:50 UTC (rev 576) @@ -380,6 +380,12 @@ done } +run-if-def() { + if type "$1" >& /dev/null + then "$@" + fi +} + # Given a regex sub-pattern and a set of files, print a sorted list of all the # words (symbols) in those files that contain that sub-pattern. Example: # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |