possible to run script to enter info within a program?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting possible to run script to enter info within a program?
# 1  
Old 06-09-2005
Question possible to run script to enter info within a program?

hi,
I am new to Unix and script writing so I was wondering if this would be possible and how I might do it. I've learned to write a basic script and the first step I need to do is to open a program (for genetic linkage). The program then requires me to enter a lot of information. Sort of line by line about 4 times. Can I somehow put this into the script so it will enter the correct information when the program requests it? Basically that would save me having to type it in over and over again. I tried using echo but that doesn't work within the program I have opened. It only seems to type the information after I have exited the program manually.

Any help would be appreciated or let me know if this is impossible. Thanks!
# 2  
Old 06-09-2005
Post your script so we know what you tried. Also which version of unix? (uname -a will tell you) In the worst case you would need to use the program called "expect" which is available for free. It can fake out any interactive program. Do you have "expect" already? Try "which expect" to find out.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl program to run a Shell script issues...

Hi all, I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran. I get an error, of course, since I don't know what I'm doing really. Here is the code: #!/opt/perl/bin/perl -w ... (14 Replies)
Discussion started by: zixzix01
14 Replies

2. Homework & Coursework Questions

Run Program from Bash CGI-Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This is a problem I am having with my 2 semester senior project. I have a LAMP server running Ubuntu 9.10 with... (8 Replies)
Discussion started by: JMooney5115
8 Replies

3. Shell Programming and Scripting

Shell script to run a python program on multiple entries in a file

Hello I am trying to run a python program using shell script, which takes a single argument from a file. This file has one entry per line : 1aaa 2bbb 3ccc 4ddd 5eee ... ... ... My shell script runs the program, only for the last entry : #!/bin/sh IFS=$'\n' for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies

4. Shell Programming and Scripting

Run a bash script, display on the screen and save all information in a file including error info

Hi all, How to: Run a bash script, display on the screen and save all information in a file including error information. For example: I have a bash script called test.sh now I want to run the test.sh and display the output on the screen and save the output including error info to a file. ... (1 Reply)
Discussion started by: Damon sine
1 Replies

5. Shell Programming and Scripting

How to enter commands to the command prompt in a program

Hey, So I'm trying to write a program in unix to automate a process for my astrophysics research. Basically I want the program to prompt the user for some information and store the entered string of text as a variable. I know how to do this. This is where I need help: Now lets say I have a... (4 Replies)
Discussion started by: freemoniez
4 Replies

6. Shell Programming and Scripting

Run shell script from C program by calling fork and execl

I need to write a c program that uses the fork and excel system calls to run the shell script mode invoked like this: "./mode 644 ls -l" (that is the argumetns will always be 644 ls -l) here's the mode script: #!/bin/sh octal="$1" shift find . -maxdepth 1 -perm $octal -exec $@ {} \; ... (3 Replies)
Discussion started by: computethis
3 Replies

7. Shell Programming and Scripting

Can you run a unix script from a perl program

Hi all i have a unix script reformatter.sh i have a process whereby this script reformats a file before a perl program is used to update it i am having a little problem automating the entire process . is there a way whereby i can call the unix script from the perl program ? (12 Replies)
Discussion started by: dwightja24
12 Replies

8. Programming

program or script to display user info

I'm on a Linux machine and need a program that will display user information as follows: user name, user directory and current date & time. I think we can compile C, C++ and Perl. All help is appreciated. (4 Replies)
Discussion started by: flasun
4 Replies

9. Programming

Getting process info in a program

Hi, I am wondering if there is a way to find out in a C software program if a particular process is running without having to write a file. In the past, I have been using the system command to execute a pgrep and output the info to a file. Then the C program reads the file to make the... (1 Reply)
Discussion started by: herbmiller
1 Replies

10. Shell Programming and Scripting

want to run different files under the same program using shell script

suppose have different files 1.1 2.2 3.3 4.4 5.5 All the files have to run under the same command say tr -d '\n' so how to run all the files under the same command by using shell script (3 Replies)
Discussion started by: cdfd123
3 Replies
Login or Register to Ask a Question