Help me to write as korn shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help me to write as korn shell script
# 1  
Old 11-22-2010
Help me to write as korn shell script

Hi..

This is step to telnet from linux to my window telnet server and run a program called CLISMS.exe. As your information, the program will be sent out a sms to my mobile number. The step as below:-

Code:
telnet 123.123.123.123
Trying 123.123.123.123...
Connected to 123.123.123.123.
Escape character is '^]'.
Welcome to Microsoft Telnet Service

login: ftpadmin
password:

*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Documents and Settings\ftpadmin>cd \
C:\>CLISMS.exe /port=1 /to=0133034931 /msg=keke keke
C:\>exitConnection closed by foreign host.

The problem is how could i write the steps on korn shell script ?. Please help me..

I have write the script as below but the program look not executed and i not received the SMS. Why ?
Code:
(sleep 1; echo -e "ftpadmin\r"; sleep 1; echo -e "ftpadmin\r"; sleep 1; echo -e "cd \ \r"; sleep 1; echo -e "CLISMS.exe /port=1 /to=0133034931 /msg=keke keke\r"; sleep 5; echo -e "exit\r") | telnet 192.168.2.163

Thank you,
baharin
# 2  
Old 11-22-2010
Code:
man expect

If you don't have expect, install it and read the document.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

2. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

3. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

4. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

5. Homework & Coursework Questions

Korn Shell Script

1. The problem statement, all variables and given/known data: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. 2. Relevant commands, code,... (3 Replies)
Discussion started by: burm
3 Replies

6. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

7. Shell Programming and Scripting

How to write comments in Korn shell script

What is the syntax for writing comment code in Korn shell scripts? (1 Reply)
Discussion started by: sasaliasim
1 Replies

8. AIX

Help with Korn Shell script

I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies

9. UNIX Desktop Questions & Answers

korn shell script

hi all i am writing the korn shell script. i have a SQL script which gives me the folowing output DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400 DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400 DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies

10. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies
Login or Register to Ask a Question