I need help to run this utility from a shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I need help to run this utility from a shell script
# 1  
Old 01-08-2009
I need help to run this utility from a shell script

I need some help to run this executable from within a shell script.

The Script is run the following way at the command prompt.

$rateupd
Main Menu --Standard Output
----------- --Standard Output
1. - Update Rate --Standard Output
2. - Exit. --Standard Output

Enter Selection: 1 --User Input

Beginning Rate Update Process

Enter Rate Data Source: xxsource --User Input
Enter Rate Server Name: xxserver --User Input
Enter Rate User ID: xxuser --User Input
Enter Rate User Password: xxpasswd --User Input
Enter the Path of the update file: /aaa/bbb/load_file.txt --User Input

Rate Update Successful. --Standard Output

I would like to know if it is possible to run the above script by passing those inputs from within a shell script.

Any help is greatly appreciated.
# 2  
Old 01-08-2009
use 'select' to create your 'Menu'
use 'read' to read user input.
# 3  
Old 01-08-2009
Vgresh99

In my post 'rateupd' is the executable that is being run.

I want to wrap it in a shell script where I can pass 'rateupd' the varibles which it reads from the input.

Since the partmeters (Input variables) for 'rateupd' are sequentially read from the input. I want to know is there any way I can run 'rateupd' from within the wrapper shell.
# 4  
Old 01-08-2009
yes, that's why the 'wrapper' script is called 'wrapper' - it 'wraps' the already existing utility with the 'simplifying' calling logic.
# 5  
Old 01-08-2009
I do not want the shell to prompt me to enter something at the input. I want the hardcoded variables to be passed within the shell. Is that possible? I thought there was some way to collect keystrokes in a file and pass it to the executable (In this case rateupd). I have never done it. I just needed an example so that I can use it.
# 6  
Old 01-08-2009
you can try something like this with the here-doc:
Code:
#!/bin/ksh

rateupd <<EOF
1
xxsource
xxserver
xxuser
xxpasswd
/aaa/bbb/load_file.txt
EOF

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Red Hat

Unable to run crash utility

Hi I have a system running cat etc/redhat-release Red Hat Enterprise Linux Server release 7.0 (Maipo), and I am trying to check why is crashing a lot of times. I have checked the following files, but with no sucessfull results: ls -lrt *.log -rw-r--r--. 1 root root 29925 Dec 23 2015... (1 Reply)
Discussion started by: fretagi
1 Replies

3. Shell Programming and Scripting

Using sendmail utility in K Shell script

Hi, I am new to shell scripting and thus any help will be highly appreciated. I need to write a K shell script where in the email sending feature should be handled by sendmail utility and I have come up with the following : #!/usr/bin/ksh echo "This is a test mailest mail" | /usr/lib/sendmail... (4 Replies)
Discussion started by: sdiptanil
4 Replies

4. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

5. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

6. Shell Programming and Scripting

Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell this is the code the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Discussion started by: wingchun22
1 Replies

7. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

8. Shell Programming and Scripting

How to write DB2 Load Utility in Shell script

Hi, I am a beginner. I need an example of using DB2 Load Utility in Shell script. I appreciate if anyone could help me about it. Thanks, Paris (0 Replies)
Discussion started by: parisbeginner
0 Replies
Login or Register to Ask a Question