Suplying stdin input within script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Suplying stdin input within script
# 1  
Old 07-25-2012
Suplying stdin input within script

HTML Code:
Hi ,
 
 I have script in that , i uninstall rpm using rpm -ef $rc1   

now my query is rpm -ef is asking user input DO YOU Want To continue (YES/NO) for each uninstalltion.

now i want to supply YES variable when it asks for above statement .

 so that i dont have to give user input from keyboard , it should proceed by taking yes .


Any suggestions ?

Thanks in advance
# 2  
Old 07-25-2012
try

Code:
 
echo YES | rpm -ef $rc1

# 3  
Old 07-25-2012
No itkamaraj

its still waiting for input , i tried this before.


Creating Log file for the Adapters-HTTP Adaptation uninstallation Script
Logs for the Adapters-HTTP Adaptation uninstallation scripts can be found at /uninstall-Adapters-HTTP-adaptation_25-07-2012_12-30-52s.log
Wed Jul 25 12:30:53 IST 2012 |DO YOU REALLY WANT TO UNINSTALL Adapters-HTTP MODULE(YES/NO):
# 4  
Old 07-25-2012
# 5  
Old 07-25-2012
no its not working as per links
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with the Script to pass stdin in run time

I have put a script inside bash_profile of user "root". That script executes when we do "sudo su -" and prompts with a question : "Why are you logginf as root?" and users have to pass the reason then they get prompt. Inside script we have used "read -p input" to take input from user. I am a... (3 Replies)
Discussion started by: shekhar_4_u
3 Replies

2. Shell Programming and Scripting

Accept data from file or stdin in script

I have a script that looks like this:sed -f myfile.sed $1 > $1.out called myscript and would like to change it so the parameter isn't necessary: ls *.idx | myscript | xargs some_command What do I need to add so it can run either way? TIA ---------- Post updated at 09:41 AM ----------... (1 Reply)
Discussion started by: wbport
1 Replies

3. UNIX for Beginners Questions & Answers

How to use stdin as argument for script?

Say I had an extremely simple script called testScript.sh: #!/bin/sh echo $1 and I invoked it as: source testScript.sh <<< x or source testScript.sh <<< inputFile.txt When I do the above the values don't appear in the echo statement, and I know that is because in the echo... (5 Replies)
Discussion started by: steezuschrist96
5 Replies

4. Shell Programming and Scripting

Passing stdin value into a script that is called from another script

I'm trying to automatically pass user input values into a script that is being called from another script, below is my current script and I added a comment next to the script where it asks user to enter input value. Thanks, mbak #!/bin/ksh echo " Adding disks for DB server then Enter YES... (2 Replies)
Discussion started by: mbak
2 Replies

5. Shell Programming and Scripting

script hangs when reading from stdin

script: while read inputline; do if ; then if ; then break fi fi done Looks like the script hangs when stdin is empty or contains space. Any ideas on how to circumvent this? is it possible to use getline to process stdin content? (4 Replies)
Discussion started by: ux4me
4 Replies

6. Shell Programming and Scripting

usinf STDIN or ARGV, taking the input, calling the library and printing results

Good morning!! I wrote a script and Im not the best at Perl so I would like someone to look it over....just in case. Ive been working on this script forever!! The script is supposed to: Have the user enter a number using STDIN. Calculate the average of the numbers, the total of all of the... (0 Replies)
Discussion started by: bigben1220
0 Replies

7. Shell Programming and Scripting

Shell script to pass multiple stdin to prorgam?

Running on AIX 5.3L. I have a program "foo" written in Fortran that requires 3 levels of inputs from stdin (command prompt). > foo Enter Input 1: a Enter Input 2: b Enter Input 3: c running foo success! > How do I get a shell script to run this automatically? > echo "a" | foo... (2 Replies)
Discussion started by: discoganya
2 Replies

8. Shell Programming and Scripting

reading from stdin in a shell script

Hello, I've managed to get my .procmailrc file to work. At least it triggers a script which creates a file. But the file is empty. How do I get at the data that's been piped? I've done much creative googling to no avail. I belive it should be in stdin, but I can't figure out how to access... (4 Replies)
Discussion started by: mmesford
4 Replies

9. Shell Programming and Scripting

Cannot redirect to STDIN in a shell script

I am unable to use STDIn redirection with < (commands) When I do the following, both approaches work and give the same results: 1. $ printf "aaa\nbbb\n" > file1 $ printf "111\n222\n" > file2 $ cat file1 file2 aaa bbb 111 2222. $ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") aaa... (8 Replies)
Discussion started by: metaltree
8 Replies

10. Programming

Changing stdin from file redirection to console input

Hi I am doing file redirection at console for use by my binary. %console%> bin &lt inputfile After reading in the entire file, I want my program to continue taking input from the console. So essentially I want to redirect stdin back to console. But I cant figure out how to do it. I am... (4 Replies)
Discussion started by: nauman
4 Replies
Login or Register to Ask a Question