Access to Prompt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Access to Prompt
# 1  
Old 03-19-2013
Access to Prompt

Hello,

I have a question concerning the following script which I can execute in a terminal:

telnet horizons.jpl.nasa.gov 6775

I will be asked to enter a certain number in order to select an object
(just for completness 301=moon, the tool yields the ephemeris for solar system objects)

Horizons> 301

now I have to press Enter for continuing...

Next step is for example ([E]phemeris:

Horizons>E

and so on....

My question:

Is it possible to enter the full information (e.g 301 && E.....) at once?
If yes, can I read in a (shell) script in order to run the object selection?

I am not an expert....

Thanks!
Gordon
# 2  
Old 03-19-2013
Automating telnet can be annoying. It doesn't have well-defined control mechanisms for text buffering and process control and multiple streams the way ssh has, which makes automating it a long sequence of print ; sleep ; print ; sleep ; print ; sleep etc.

Expect might help you. autoexpect in particular, which can generate a script from commands you execute, which you can modify to your needs after.
# 3  
Old 03-21-2013
Hello Corona688,

thanks for answer!
I will give it a try.

Cheers,
Gordon
# 4  
Old 03-25-2013
Hi,

autoexpect works fine! I can perform all the things I want, execept the following:

I execute the following command:
Code:
./new2Script.exp 301 E o coord g \" 44.33 33.33 0.034\" y \" \ BC78-Jun-30 00:00\" \"BC78-Jun-30 23:59\" 6h n \" 2 4 31\" Refracted \
| grep b0 > object1.csv

That means, all lines including "b0" will be passed to the script object1.csv.
The problem, when I run telnet in the terminal I get the following output:
Code:
.....
.....
b0100-Jun-22 05:41, 1685070.736805556,*, ,287.52610,-27.62500, 254.8621,-29.9992, 285.5319607, -4.8664092,
 < Scroll & Page: space, <cr>, <b>ack, OR arrow keys. <q> ends display. > 1

that means the script does not show the full output.
The user has to scroll down in order to see further output. Unfortunately, my command cannot handle it.
Is it possible to show the full output?

Cheers,
Gordon

Last edited by Corona688; 03-25-2013 at 12:36 PM..
# 5  
Old 03-25-2013
Without seeing your expect script it's hard to correct it, but one could probably get it to respond to the line "< Scroll & Page: space, <cr>, <b>ack, OR arrow keys. <q> ends display. >" by printing a space.
# 6  
Old 03-26-2013
Hi,

the code is in attachment.

Cheers,
Gordon
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Unable to move from rsc prompt to ok prompt

Hi, on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies

2. Solaris

Can't use 'break' command, Can't access 'ok' prompt.

Hi I have A Sun Ultra Enterprise 450 server, it has Solaris installed on it. I have A serial terminal hooked up to it (nullmodem cable plugged into serial port 1 on the box, and the other end plugged into the serial port of A laptop (NEC Versa M300)) The laptop is running Ubuntu 12.04.2... (3 Replies)
Discussion started by: SomeoneTwo
3 Replies

3. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

4. Solaris

samba read write access to owner and no access to other users

Hi All, I want to configure samba share permission so that only directory creator/owner has a read and write permission and other users should not have any read/write access to that folder.Will that be possible and how can this be achieved within samba configuration. Regards, Sahil (1 Reply)
Discussion started by: sahil_shine
1 Replies

5. UNIX Desktop Questions & Answers

Can Unix access Windows' File through Command Prompt in Unix

Hi all, I wish to know whether Unix can access window's file in Unix's terminal? Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies

6. Shell Programming and Scripting

how do i access db2 instance via telnet command prompt

Hi I have a perl script code in which connecting with db2 database and doing some process. My perl script code and db2 database server present in the same unix server. I am connecting and executing perl script code via windows telnet. Now my question is i could not able to connect db2 server... (4 Replies)
Discussion started by: solo123
4 Replies

7. UNIX for Dummies Questions & Answers

kernel giving access for multiple users to access files

hi all, i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies

8. Solaris

ultra sparc 2 no video - ok prompt access

I have an ultra sparc 2 with no video - I connect to it with hyperterm. Is there a way to get to the OK prompt? I have tried control/break and that does not work. If not is there a video card I can get to put in this box? I have Solaris 10 installed on this machine. Thanks (7 Replies)
Discussion started by: tribbles
7 Replies

9. Windows & DOS: Issues & Discussions

Wants to delete a file on window 2000 Pro but prompt Access Denied

Kindly give me insight to this problem that l am encountering on window 2000 professional. I want to delete a file with .dll. If l delete the file its prompt access denied. Every option under the file attribute signify that the no deny was checked, but still l can't delete the file. Also l tried... (3 Replies)
Discussion started by: kayode
3 Replies

10. UNIX for Dummies Questions & Answers

Need help to access/mount so to access folder/files on a Remote System using Linux OS

Hi I need to access files from a specific folder of a Linux system from an another Linux System Remotely. I know how to, Export a folder on One SCO System & can access the same by using Import via., NFS in the Sco Unix SVR4 System using the scoadmin utility. Also, I know to use mount -t ... (2 Replies)
Discussion started by: S.Vishwanath
2 Replies
Login or Register to Ask a Question