The content of 'cmds.txt' is as follow:
ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami"
ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami"
ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami"
ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami"
ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami"
I'm trying to iterate through this file in prompt and execute them respectively. My command is:
export IFS=$'\n'; for i in `cat cmds.txt`; do $i; done
But it complains bash: ssh -o "StrictHostKeyChecking no" [email protected] "/usr/bin/whoami": No such file or directory.
Is there anything I'm missing? Thanks a lot.