我正在編寫腳本,但得到錯誤:語法錯誤:單詞意外(期待「在」) 我真的不知道錯誤可能在哪裏語法錯誤:字意外(期待「in」)
#!/bin/bash
for dir in "[email protected]"
do
mv "$dir"/* /tmp
done
if [ $# -lt 1 ] ; then
echo "ERROR: no argument"
exit 1 # pas 0
else
case $#
-d) mv -R $dir/* /tmp
;;
-x) find -executable -type f | xargs mv -t "$dir"/* /tmp
;;
esac
fi
你的腳本真的是雙倍間距嗎?所有這些空行都不是特別有用。一致的縮進將是。 – 2014-08-27 18:16:29
您可能想要閱讀'bash'手冊頁中的'getopts'命令。 – chepner 2014-08-27 18:32:23