I have a shell script which does the encryption of a file where i am passing the file name as a command line argument,but later on the script waits on the screen to enter Y or N
what is the command i should be using on the shell script
I want to automate the process ..so
When I run the shell script, I know it will wait for the user input.
since this might run at night, there might be noone to input, so i want to pass it along with command line itself, so when it asks for user input, it takes the parameter passed on the command line.....
...
if [ "$1" = "" ]; then ## No parameters were entered
echo "Enter value:"
read mInputValue
echo "You entered: "$mInputValue
else
mInputValue=$1
echo "The input parameter was "$mInputValue
fi
...
>>...
>>if [ "$1" = "" ]; then ## No parameters were entered
>> echo "Enter value:"
>> read mInputValue
>> echo "You entered: "$mInputValue
>>else
>> mInputValue=$1
>> echo "The input parameter was "$mInputValue
>>fi
>>...
here once I enter the $1 parameter,
the command that i run in the script is asking me for confirmation (user input) ( y or n)
in order to run successfully, i have to enter y at the prompt( manually).
so to avoid the manual entry ...
how do i avoid the prompt and give "y" in the script itself