Automate response to prompt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Automate response to prompt
# 1  
Old 07-02-2008
Automate response to prompt

I'm running a program in the terminal on a computer running ubuntu. After inputing a file containing 900 data sets, I have to enter the line number a particular data set I want to analyze begins on, followed by the number that corresponds to the type of analysis I want. I have to do this for every single set of data, which I don't so much mind when the sets are fairly small. However, my most recent file has 900 sets of data, and I'd love to automate the process. Basically, I'd like to create a program that, when prompted with a request for the line number, automatically enters 1+n*44, return, 3, return. And I'd like it to run from n=0 all the way to n=899, preferably in sequential order.
Any idea how to do this? Can one even set up a program that responds to the prompts of another program? Is this even the right forum for a question like mine? Or do I need to start learning my 44 times tables and clearing out my social schedule? Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Response Times

Hello all. Let me qualify my question by saying that I am struggling with how to ask the question I am semi green but have no issue reading up if pointed in the right direction. Please be gentle! A RHEL server 6.2. Hosts a statistical application that has some web apps and batch programming... (0 Replies)
Discussion started by: rsheikh01
0 Replies

2. 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

3. IP Networking

Tweaking the DNS response

Hi All, The following is the scenario. I open the browser and request a web page. The DNS query is sent to the DNS server of my company and replies my GNU/Linux machine with a DNS response. I have "insmod"ed a kernel module that picks up the DNS response and over rides the "Addr" field of... (2 Replies)
Discussion started by: rstnsrr
2 Replies

4. 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

5. AIX

Ping response

:confused:Hi, In linux if ping to a system from a linux server it shows ping time=0.120ms how we can achive this in aix. i need this for a latency check. Thanks in advance. (5 Replies)
Discussion started by: vjm
5 Replies

6. IP Networking

Traceroute response

I have 20 servers I installed an application to that is returning message " wrong dispatcher or port " when starting agents. They all have the same dispatcher ip and going through the same port number. After verifying there are no application issues, we figured it was firewall related. The Firewall... (1 Reply)
Discussion started by: HFJ
1 Replies

7. UNIX for Dummies Questions & Answers

response of a for loop?!

Dear guys, I don't know the response of a for loop in this situation: suppose that file1 is an empty file. and i make a for loop as : for i in `cat file1` What will be the response of the for loop: 1- will an error message apear 2- or the for loop simply will not run,and it will escape... (2 Replies)
Discussion started by: marwan
2 Replies

8. SCO

Slow cd response

Hi All We have one SCO Server here and it never gives us any trouble. Until Now!! Well its not earth shattering but we have one user who is complaining of a very slow response time when changing to his Home Directory. Other users who have similar profiles are OK. I have su'd to this user and I can... (0 Replies)
Discussion started by: JohnOB
0 Replies

9. Post Here to Contact Site Administrators and Moderators

Response to Homework Questions.

Just a suggestion, but it might help to pare down the number of threads that have little "added value" if the Moderators were to delete these posts rather than simply "close" them. Case in point, this thread was started by someone who asked for a homework solution. The poster received a reply... (2 Replies)
Discussion started by: google
2 Replies
Login or Register to Ask a Question
XTELL(1)						      General Commands Manual							  XTELL(1)

NAME
xtell - sends a message to another computer running xtelld SYNOPSIS
xtell [-v] [user[:tty][@host[:port]]] [message] write user [tty] DESCRIPTION
How to use it: suppose you want to send a message to user gubas on computer trener.fsport.uniba.sk Just type: prompt:~% xtell gubas@trener.fsport.uniba.sk Hi To send multiple lines long message to user 7tokarova at computer pascal.fmph.uniba.sk, type prompt:~% xtell 7tokarova@pascal.fmph.uniba.sk Hi How are you today Please answer ^D in this case, finish sending messages with EOF (CTRL D) If you want to send message to user holik on local computer, you can do it either by typing: prompt:~% xtell holik@localhost Hi or simply: prompt:~% xtell holik Hi To send message to certain tty, append the tty to username, separated by colon: prompt:~% xtell stanys:ttyp2@reaktor.ip.fmph.uniba.sk 'Sveikas Tomai' will send message 'Sveikas Tomai' to user stanys on ttyp2 at computer reaktor.ip.fmph.uniba.sk To specify other port than the default 4224, append the port to computer name, separated by colon: prompt:~% xtell bosa@radon.dnp.fmph.uniba.sk:4000 'Ahoj' assumes the xtell daemon runs at computer radon on port 4000, and sends the message 'Ahoj' to user bosa. Option -v turns verbose mode on. Xtell will then display some messgaes about connecting, which is usefull especially when the connection is slow. Example: prompt:~% xtell -v rybar@dmpc.dbp.fmph.uniba.sk xtell invoked without parameters will ask user for username and host to send the message to. If the user has created in his/her/its home directory the file .xtell-log, and the file is writable by nobody, all messages will be written to this file as well as to the screen (handy when the screen is overwritten and you could not see the message). xtell checks the environmental variable XTELLPROMPT. If it exists, it is used as prompt for messages. Last notice: if you do not think zsh is the best shell, (besides doing a mistake) replace prompt:~% in above text with prompt:~$ or what- ever :-) AUTHOR
Radovan Garabik (garabik@melkor.dnp.fmph.uniba.sk) SEE ALSO
xtelld(8), write(1), talk(1), talkd(8), tty(1) BUGS
What happens to .xtell-log when two messages arrive simultaneously? There is no locking implemented. XTELL(1)