I keep getting ambiguous redirect in bash script.
I'm new, so if someone could explain why I'm getting this with my following code, that would be great.
Here's my code!
$input = [user inputs an email]
$variable=$(date +"%Y-%m-%d-%H:%M")
$mem_list=/root/Desktop/Dan/Logs/member-name-file" "$variable.txt
Here's the code that's getting ambiguous (there's a couple of these, but same problem.
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
Help me kindly, thanks!