I created this bash script to run python code on each host listed in my ip_list
:
#!/bin/bash
declare -a ip_list=('10.99.1.1' '10.99.1.2' '10.99.1.3"' '10.99.1.4');
for i in $(ip_list) ; do
ssh -i ~/Downloads/abc.pem -t -t ec2-user@$i "sudo python /home/user/abc.py"
done
But I got error:
Error: line 4: ip_list: command not found
What did I do wrong here? thanks