I'm writing a bash script to post data over network, with netcat command.
I would like my script work with pipe, well, I'm using:
while read data; do
echo "$data" >> /tmp/paste_log
That rulz, but when the input data if finish, I would like ask to the user, a captcha system for bot prevention.
[... get data from server ...]
read -p "answer: " myanswer
[... output data with netcat ...]
The problem: "read" command is skipped when I use pipe, well "myanswer" is blank. 'Read' take the pipe as input data.
How can I read from stdin, after a pipe, without launch a second script ?
Sorry for my english. If you don't understand it, ask me