shell script for interactive cmd
|
Original Message
|
Name: komanche
Date: April 4, 2007 at 09:19:02 Pacific
Subject: shell script for interactive cmdOS: SolarisCPU/Ram: anyModel/Manufacturer: any |
Comment: We want to write a shell script execute a set of commands , the problem is the commands specified in the script ask for user intervention say for eg: if the command is reset bts-123 when u execute the above command it ask's "are you sure you want to execute this command" i want to give a default value of yes to all these , kindly help in creating a script which wud take a value of yes for all the questions.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: nails
Date: April 4, 2007 at 12:22:23 Pacific
|
Reply: (edit)I'm not sure what you want. You can place the answers to the question in a file and redirect that file. Consider an example. I have this test.ss script: #!/bin/ksh echo "first prompt" read x echo $x echo "second prompt" read y echo $y # end script This requires the user to input twice. Now, place the answer to each prompt in a file called prompt.txt: y y Execute this command and the user isn't prompted: test.ss < prompt.txt
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: jefro
Date: April 4, 2007 at 14:29:50 Pacific
|
Reply: (edit)If that doesn't work ( and it should) you might see if you commands have a switch for quiet or null or something like that. I read it wrong and answer it wrong too. So get off my case you goober.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: