Created
November 19, 2012 12:55
Revisions
-
yonchu created this gist
Nov 19, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/sh # # Edit command source # if [ $# -lt 1 ]; then echo 'Should specify commands you want to edit' 1>&2 exit 1 fi cmds=() while [ $# -gt 0 ]; do cmds+=($(which "$1" 2> /dev/null)) [ $? -ne 0 ] && echo "Command not found: $1" 1>&2 shift done if [ ${#cmds[@]} -lt 1 ]; then exit 1 fi exec ${EDITOR:-vim} "${cmds[@]}"