我的合作伙伴和我遇到了這個基本的Linux腳本的麻煩。我們的教師在我們身上傾倒了一個高級的Linux腳本包來進行調試,我們都很迷茫。該腳本假設刪除文件名中包含嵌入空格的文件,並且卡在實際的rm命令上。我得到「失蹤的操作數」,我不知道該怎麼做。Linux rm命令與變量
#!/bin/bash
# This script is supposed to delete all filenames in current directory
#+ containing embedded spaces.
# It doesn't work
# Why not?
badname= ls | grep " "
# Try this:
echo "$badname"
rm "$badname"
exit 0
你會得到什麼錯誤或消息? – 2014-11-05 17:33:27