想請教一個寫shell script的簡單問題 - BBS

Table of Contents

※ 引述《cooper6334 (小恐龍)》之銘言:
: 小弟這個學期初學unix
: 現在學到了用bash shell來寫shell script
: 手上有個作業是要用迴圈來把變數都印出來
: 也就是說輸入 檔名 a b c
: 就要echo出a b c

如果你是要印整個變數出來的話,你可以考慮用 $@

for i in $@
do
echo -n "$i "
done

這樣就解決了。

--
I will use Google before asking dumb questions.

--

All Comments