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
ct(1C)							      Communication Commands							    ct(1C)

NAME
ct - spawn login to a remote terminal SYNOPSIS
ct [options] telno... DESCRIPTION
The ct utility dials the telephone number of a modem that is attached to a terminal and spawns a login process to that terminal. The telno is a telephone number, with equal signs for secondary dial tones and minus signs for delays at appropriate places. (The set of legal char- acters for telno is 0 through 9, -, =, *, and #. The maximum length telno is 31 characters). If more than one telephone number is speci- fied, ct will try each in succession until one answers; this is useful for specifying alternate dialing paths. ct will try each line listed in the file /etc/uucp/Devices until it finds an available line with appropriate attributes, or runs out of entries. After the user on the destination terminal logs out, there are two things that could occur depending on what type of port monitor is moni- toring the port. In the case of no port monitor, ct prompts: Reconnect? If the response begins with the letter n, the line will be dropped; otherwise, ttymon will be started again and the login: prompt will be printed. In the second case, where a port monitor is monitoring the port, the port monitor reissues the login: prompt. The user should log out properly before disconnecting. OPTIONS
The following options are supported: -h Normally, ct will hang up the current line so that it can be used to answer the incoming call. The -h option will prevent this action. The -h option will also wait for the termination of the specified ct process before returning control to the user's terminal. -sspeed The data rate may be set with the -s option. speed is expressed in baud rates. The default baud rate is 1200. -v If the -v (verbose) option is used, ct will send a running narrative to the standard error output stream. -wn If there are no free lines ct will ask if it should wait, and for how many minutes, before it gives up. ct will continue to try to open the dialers at one-minute intervals until the specified limit is exceeded. This dialogue may be overridden by specifying the -wn option. n is the maximum number of minutes that ct is to wait for a line. -xn This option is used for debugging; it produces a detailed output of the program execution on stderr. n is a single number between 0 and 9. As n increases to 9, more detailed debugging information is given. FILES
/etc/uucp/Devices /var/adm/ctlog ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbnuu | +-----------------------------+-----------------------------+ SEE ALSO
cu(1C), login(1), uucp(1C), ttymon(1M), attributes(5) NOTES
The ct program will not work with a DATAKIT Multiplex interface. For a shared port, one used for both dial-in and dial-out, the ttymon program running on the line must have the -r and -b options specified (see ttymon(1M)). SunOS 5.10 14 Sep 1992 ct(1C)