telnet and run scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting telnet and run scripts
# 1  
Old 07-17-2008
telnet and run scripts

Hello folks,
I've got this script which connects to different boxes and executes a certain script in those locations. The following is the line from where i am trying to do this:
(sleep 1; echo $USERID ; sleep 1; echo $PASSWD ; sleep 1 ; echo y ; sleep 1 ; echo "\r" ; sleep 1 ; echo "cd $FILEPATH" ; sleep 1 ; sleep 1 ; echo "./MessageCount.sh $BOXNAME $PATHNAME $FILENAME |&" ; sleep 80)| telnet $SERVER
Do i actually need to give the 80 seconds sleep time since it is running in the background?
The other (real) problem that i am facing is that the connection to the boxes are getting closed even before the scripts have finished running.
Thanks a lot.
# 2  
Old 07-17-2008
See:
changepass automate password changes on multiple systems
as an example of my approach to this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Scripts can be run manually but couldn't run with cronjobs

I am from MQ/MB technology. My requirement is to display the queue manger and broker status on daily basis. If I manually run the script, it works fine and displays output. But when I have scheduled the same using cronjobs it shows only the queue manger status and not the broker status. Can... (3 Replies)
Discussion started by: Anusha M
3 Replies

2. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

3. Shell Programming and Scripting

How to run scripts within a telnet session?

I want to connect to a remote host using telnet there is no username/password verification just telnet remotehost then I need to input some commands for initialization and then I need to repeat the following commands: cmd argument argument is read from a local file, in this... (1 Reply)
Discussion started by: esolve
1 Replies

4. Windows & DOS: Issues & Discussions

telnet scripts in windows

Hi, I am new to scripting & i want to write a script to fetch some report. For an example i am having a windows server which is having n number of child devices itself..I know all the Ip address of the child devices.. I wnt to login into all the child devices & fire a command & finally i need... (5 Replies)
Discussion started by: wellington
5 Replies

5. Shell Programming and Scripting

telnet scripts

Hi, Can someone please send me a sample script to login to a specific device and do someme command then logout. Thanks.. (3 Replies)
Discussion started by: rbn1226
3 Replies

6. Shell Programming and Scripting

Execute scripts from remote using telnet

Hi having the below code (sleep 1 echo "username" sleep 2 echo "password" sleep 2 echo "cd /home/test1/path" sleep 10 echo "ls -l | grep filename" if exists echo "script1.sh filename" echo "mailx -s "Task Executed" user@domain.com" else echo "mailx -s "File not Exist"... (1 Reply)
Discussion started by: karthikn7974
1 Replies

7. Windows & DOS: Issues & Discussions

run dos telnet service

hi , i need a telnet server for dos(telnet from unix server to dos client) , so how can i run telnet service on dos ? (0 Replies)
Discussion started by: shrb78
0 Replies

8. Cybersecurity

run dos telnet service

hi , i need a telnet server for dos(telnet from unix server to dos client) , so how can i run telnet service on dos ? (0 Replies)
Discussion started by: shrb78
0 Replies

9. SCO

run dos telnet service

hi , i need a telnet server for dos(telnet from unix server to dos client) , so how can i run telnet service on dos ? (0 Replies)
Discussion started by: shrb78
0 Replies

10. UNIX for Dummies Questions & Answers

Exit from telnet when run Remotely

ssh user@host -q -n 'grep `hostname` /etc/hosts; telnet 10.100.23.45 1234;' When i run this command remotely it is hanging and not giving me the prompt, Can anyone tell me how can I exit a telnet command remotely please. Thanks. (10 Replies)
Discussion started by: venu_nbk
10 Replies
Login or Register to Ask a Question