以下示例是通过 telnet 远程到终端设备,并执行删除文件的命令:
#!/bin/bash
user="root"
pass="admin"
ip="192.168.3.3"
{
sleep 1
echo "$user";
sleep 1
echo "$pass";
sleep 1
echo "rm /home/Water/Business.dat"
sleep 1
echo "reboot"
}|telnet $ip
以下示例是通过 telnet 远程到终端设备,并执行删除文件的命令:
#!/bin/bash
user="root"
pass="admin"
ip="192.168.3.3"
{
sleep 1
echo "$user";
sleep 1
echo "$pass";
sleep 1
echo "rm /home/Water/Business.dat"
sleep 1
echo "reboot"
}|telnet $ip