I have a script (from a vendor.. for masking passwords) that walks through a series of user inputs, and generates some output based on input. I would like to be able to wrap another script around it which feeds the input from a text file, and then captures the output for later use. Anyone have any examples of this?
UPDATE: I've done some digging, and it turns out the shell script is kicking off a java process which is what is requesting user input. xargs and <,>,| don't seem to work for this.
myscript < input_file > output_file
(from the command line) will read input_file
line by line as if it were user input, and then write the output to output_file
. Be careful though, if output_file
already exists, it will be completely overwritten without any warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With