我在bash腳本中不斷得到模糊的重定向。與我的「模棱兩可的重定向」相混淆
我是新來的,所以如果有人能解釋爲什麼我用我的下面的代碼得到這個,那就太好了。
這是我的代碼!
$input = [user inputs an email]
$variable=$(date +"%Y-%m-%d-%H:%M")
$mem_list=/root/Desktop/Dan/Logs/member-name-file" "$variable.txt
這裏有一個是越來越曖昧的代碼(有一對夫婦這些,但同樣的問題。
if [[ -f $mem_list ]] #check if file exists already
then
echo $input >> $mem_list #if file is already there, just append input to the file
else
echo $input > $mem_list #if file is not found, make a new one [Error is here!!]
fi
幫助我很好,謝謝!
另請參閱[鏈接](http://stackoverflow.com/questions/2462385/getting-an-ambiguous-redirect-error) – 2016-05-05 23:52:00