How to I run a command in a shell script auto prompting yes to prompt to the use, so I can automate a script?
|
feedback
|
|
expect is the usual tool for this. | |||||
feedback
|
|
You should read the docs for the commands you are using in your script. Most commands that are regularly used in scripts have options that you can use to automatically respond confirmation messages. | ||||
|
feedback
|
|
If by "commands" you mean the built in cmd/dos functions like COPY XCOPY, MKDIR, etc), then you want to add the /y parameter to each command. It defaults to Yes for the built in command-line functions. But as Zoredache mentions, you should read the documention of each command you are doing (that is non-built-in functions) and find out how to default to Yes (if possible). | |||
|
feedback
|