写了一个Shell Script想更方便使用etags,结果最后echo出来的结果是对的,但是得到的TAGS居然是空的。请大家帮忙。(我觉得我可能对shell script的解释机制不理解)。
请大家指正。 (ps,如果能顺便推荐一下shell script的资料那就更好了)
#
#
# Make etags much more powerful and easy to access
#
#
str="-type f -name \"*.[ch]\" -or -name \"*.cpp\""
if [ -z $@ ]
then
command1="find ./ $str"
command2="etags -"
else
command1="find $1 $str"
command2="etags - ${@:2}"
fi
echo "$command1 | $command2"
$command1 | $command2

