My file have below data
IP USER PASSWORD
ip1 user1 password1
ip2 user2 password2
ip3 user3 password3
So I write below script for same
#!/bin/bash
for val in `awk 'NR>1 {print}' servers.list`
do
echo $val
done
But for loop is been execute 9 times and if I wrote awk command in quotes then its execute only single time.
How can I write a script so that for loop treats every line as single so that I could parse each line and can use pscpto copy data into multiple server.
Command
pscp -p mypassword /home/user/myfile.txt user@ip:/home/user/myfile.txt
If is there any better way then this to copy file into multiple server then pls specify it bcz I am new in scripting.
pscpcommand too thats why I am doing this way.pscpcommand?pscp -p mypassword /home/user/myfile.txt user@ip:/home/user/myfile.txt