Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bash to Zsh Funny



Hi,

The following runs as bash but not zsh, because the line which evaulates to:-

gvim.exe note123.txt note345.txt &

In bash fine gvim edits the two files

in zsh

gvim tries to edit the filename "note123.txt note345.txt" as tho it were one long filename


#!/bin/zsh
# gg
# description : vi all files containing $1 in name
set +x
cd c:/intranet/note/
if [ $# -gt 0 ] 
   then 
files=$(grep -il "note [0-9][0-9][0-9].*$1" $(find . -name 'note???.txt'))
if [ "$files" != "" ]
then
files=${files//[[:space:]]/ }
echo $files
gvim.exe $files &
else
echo sorry $1 not found
fi
fi




Messages sorted by: Reverse Date, Date, Thread, Author