I need to do the following which I've already started:
- Prompt user to enter a folder and see if it is readable
- If file is not readable it needs to display a message and end
- Then copy that folder into a backup folder
- Read each line of the backup folder and display each line
Here's what I have but I keep getting a missing destination operand error.
echo -n "Please enter a file name:"
if [ -r "$file" ]
echo [ $file ] >> /home/shawn/backupfile.txt
while IFS= read -r line
printf '%s\n' "$line"
done < "$file"
echo "File is not readable or does not exist"