Unix Shell scripting -How to skip User Standard input section from another script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Shell scripting -How to skip User Standard input section from another script
# 1  
Old 07-14-2010
Question Unix Shell scripting -How to skip User Standard input section from another script

All,


problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard).
Now i need to know how I can skip this user input section of script1 in script2( where script1 executable is being executed).

Looking forward your assistance, Thanks.

Last edited by techie99; 07-14-2010 at 07:52 AM.. Reason: adding code line to brief my question.
# 2  
Old 07-14-2010
Comment the appropriate line out in script1?
# 3  
Old 07-14-2010
script1 (which is being executed frm script2) is expecting user input.
Script1 shd not be modified. script2 need to be modifed, so that the below lines of user input, needs to be automated.

script1 user input:
-----------------
Would you like to:
[1] Accept the certificate for this session
[2] Accept and store the certificate
[3] Reject the certificate
Please input your selection(The default selection is [1]):
# 4  
Old 07-14-2010
Try a heredoc.

Code:
script1 <<END_RESPONSE
1
END_RESPONSE

Obviously, substitute the desired response (could be a variable or command substitution, etc) in place of "1".

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recording user input from interactive shell script

Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction. Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be... (3 Replies)
Discussion started by: shoutcast
3 Replies

2. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

3. Shell Programming and Scripting

Shell script to accept user input on the fly

I want a shell script that accepts user input simultaneously when performing other tasks. Example: A shell script should echo some messages on the console and when the user presses some keys it should respond to that action. say, when user presses the key A - more information should be printed... (2 Replies)
Discussion started by: Arun_Linux
2 Replies

4. Shell Programming and Scripting

How to check the user input to be valid using shell script?

How to check the user input to be valid using shell script? The valid input is in the format like as follows. 1. It can only have r,w,x or a hyphen and nothing else. 2. ensure the r, w, x are in the correct order. for example: rwxr-xr-x is a valid format. Thanks (5 Replies)
Discussion started by: hyeewang
5 Replies

5. Shell Programming and Scripting

generate tabular output from an input text file in unix shell scripting

Hi, I have the output (as below) which i want it to be in a table. For e.g. space utilization in PSE on path /logs is 0% space utilization in PSE on path /logs/tuxedo/tuxlsp is 16% space utilization in PSE on path /ldvarlsp/lsp/log is 37% space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies

6. Shell Programming and Scripting

User Input Shell Script

Hello I am trying to create a user input shell scipt. The objective is user should enter the circuit number and the input is saved in a log file. If the user does not enter anything then the question should prompt it until the circuit no. is entered. Can any one please correct the code below.... (3 Replies)
Discussion started by: sureshcisco
3 Replies

7. Shell Programming and Scripting

Disconnecting the User Section through Shell Script

Dear All, I am new to this forum and also I am new to Unix. Our database is running under unix. I want to write a shell script in unix to kill the user section after given idle time. This script should be applicable to specific users / should not be applicable to specific users, Could... (0 Replies)
Discussion started by: pyb_rkumar
0 Replies

8. UNIX for Dummies Questions & Answers

Unix Shell Scripting -- update employees not present in input file

ALL, My shell script takes a employee file as input. I have to identify the list of employees not in the input file and update their status in the database. Approach I followed: by traversing through the input file add all the emplid's to a variable. update the status of employees not in... (2 Replies)
Discussion started by: sailussr
2 Replies

9. Shell Programming and Scripting

Coding Standard For Unix Shell Scripting!!!

Is there any site on Coding Standard for Shell Scripting in UNIX. Please help me know!!!!! Thanks Om (1 Reply)
Discussion started by: Omkumar
1 Replies
Login or Register to Ask a Question