12345 | grepvim() { if [ -z $1 ]; then echo "Must supply search string."; return 1; fi if [ -z $2 ]; then echo "Must supply search file(s)."; return 1; fi vim $(grep $1 ${@:2} | sed -e "s/:.*$//" | sort -u) } |
1 | grepvim search file1 [file2, wildcard, etc...]
|