歡迎您光臨本站 註冊首頁

關於Shell Script的一個問題

←手機掃碼閱讀     火星人 @ 2014-03-23 , reply:0

寫了一個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

[火星人 ] 關於Shell Script的一個問題已經有543次圍觀

http://coctec.com/docs/linux/show-post-114094.html