Hi
I want to write a script file that first executes a command

/usr/sbin/alternatives --config java

which asks to enter a number.... i want to give this input automatically by the script... i dont want human intervention....how can i do this.....

Hey There,

It depends on how /usr/sbin/alernatives takes input, but two possible solutions would be

echo input|/usr/sbin/alternatives...etc

or

/usr/sbin/alternatives arg arg <input

Basically, you'll have to redirect output to be the commands input. If this is a custom script you might need to add functionality to it so that it will accept arguments from STDIN.

Best wishes,

Mike