UNIX SHELL PROGRAMING 2
2013. 5. 21. 16:00ㆍ99. 정리전 - IT/13. Unix 얇팍지식
http://ecl.informationbuilders.com/iway/index.jsp?topic=%2Fshell_60%2Fservice.manager%2Fsource%2Ftopic208.htm
TELNET SHELL SCRIPT
#!/bin/sh
#+------------------------+
#| EMR FILE DELETE |
#+------------------------+
host=100.10.10.100
user="scott"
pass="tiger"
cmd="rm -rf /cvs/dpp/emr/ERP/*"
(
echo open ${host}
sleep 2
echo ${user}
sleep 2
echo ${pass}
sleep 2
echo ${cmd}
sleep 2
echo exit
) | telnet > /home/jay/out.txt
echo " "
echo "* * * command output start * * *"
cat /home/jay/out.txt
echo "* * * command output end * * * *"
echo " "
exit 0