I am creating a log file to record user activity and also allow them to add a comment. I would like the name of the log file to be the original file and the current time here's my code
currentDate=$(date)
logFileName="$file_name $currentDate.log"
echo "$USER signed in called $file_name on " $(date) >>logFolder/$repo_name/$logFileName
read comment
echo $comment>>logFolder/$repo_name/$logFileName
but I keep getting ambiguous redirect.
edit: my script allows users to create a directory, add a new file to the directory and change the directory. When they perform any action a corresponding directory it's created in the logFolder which houses any activity done in the respective directory I also want to give the user the opportunity to add additional comments further explaining what they did. Their comment is then appended to a log file with the name of the log file being "the file they were currently working on and the current date"
e.g pizza.html Sat Oct 30 19:13:11 BST 2021