I have a remote server with a couple of cache keys and I am trying to delete them. However, I am getting an error when I am running the script.
This is the script that I am using at the moment. Also, I setup public ssh key so I don't have to type the password:
input="path to file"
while IFS= read -r line; do
ssh -tt user@192.168.20.59 "sudo -S rm $line"
done < "$input"
If I try the ssh command outside the loop will work as expected. I can't figure out why the loop affecting the command
The error that I am getting is:
No such file or directory3f971a5e192fb9332c764a636a4205f
connection to 192.168.20.59 closed.
Thank you in advance
NOTE: Fixed the issue by modifying the script which generated the file. For some reason was adding ^M at the end of the line. I used echo & cat to generate the file and avoid alien characters