
December 11th, 2001, 09:25 AM
|
|
Not there when you need me
|
|
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,430
Time spent in forums: 17 m 46 sec
Reputation Power: 13
|
|
Assuming that the user inputs are separated by the return key, you can simply echo the stuff you get from the user with some newlines into a temporary file and pass that to the program's stdin.
Like this:
Code:
echo "" > /tmp/tmpinput
chmod 700 /tmp/tmpinput
echo "$1" > /tmp/tmpinput
echo -e "\n" > /tmp/tmpinput
# etc.
myprog < /tmp/tmpinput
rm /tmp/tmpinput
I don't know if it works, though.
Btw: I hope you took passwd just as an example. You shouldn't try to do it really with that or any other security-related command.
|