Answer the question
In order to leave comments, you need to log in
Why is bash script not working?
bash script not working. the script is connected on a telnet drives in a command, but does not carry out it.
#!/bin/bash
for ip in `cat ip.txt`
do
{ echo "admin+t/r"; sleep 2; echo "pass"; sleep 2; echo "ping 192.168.20.35"; sleep 2; echo "quit" ;} | telnet $ip
done
Answer the question
In order to leave comments, you need to log in
why not make it easier?
[email protected]:~ $ ssh [email protected] ping 192.168.109.1
[email protected]'s password:
SEQ HOST SIZE TTL TIME STATUS
0 192.168.109.1 56 64 0ms
1 192.168.109.1 56 64 0ms
2 192.168.109.1 56 64 0ms
3 192.168.109.1 56 64 0ms
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question