DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Semi-automation Script Based on Sleep


The following script auto login to server 49, send 2 commands and exit from the server.

  1. Create a automation script named "auto.sh":

echo "open 10.0.2.49 -l gcp" sleep 2 echo "gcp" sleep 1 echo "ls" sleep 1 echo "pwd" sleep 3

echo "hadoop fs -put /home/boco/gdpp/91/ hdfs://cloud216:8020/user/boco/gsp/yyyy > mylog"

sleep 3 echo "exit"

  1. Make the script executable: chmod 755 auto.sh;

  2. $ ./auto.sh|telnet

Ref: http://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts



Published

Oct 14, 2013

Last Updated

Oct 14, 2013

Category

Tech

Tags

  • pipe 1
  • shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor