I have a KSH script in unix which requires the user to enter some responses (Y or N) at certain intervals of the code. I would like to automate this KSH script by redirecting the standard input.
I would like to create a text file (INPUT.TXT) which contains all the inputs.
So the file will have a list of Y and N in newlines. for example, the file INPUT.TXT will look as follows:
Y
Y
Y
Y
Y
However, I do not know how many times the code asks for inputs. So my question what if the KSH script only requires 4 Y responses and I put 6 Y responses in INPUT.TXT. will this have any effect? or will the 4 Ys be input into the script and the script will complete succesfully.
Also will this allow me to issue a nohup session on the KSH script?
for example
nohup MyScript.ksh < INPUT.TXT &
Thanks
Start Free Trial