Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to prompt for input while reading file

Status
Not open for further replies.

babcia01

IS-IT--Management
Jul 11, 2002
37
0
0
US
This is the skeleton of code from the shell I try to get to work. I experimented quite a lot with various stdin and stdout redirection commands but was not successful so far. Would anoyne know how to make possible for the echo in the below code to do what it should do which is prompt the user for entry from the keyboard?

This is the skeleton code:

#!/usr/bin/ksh
exec 5<input1
exec 6<out1
awk 'BEGIN {
}
{
x=$1
print ""x""
echo "do you want to continue y/n ===> \c"
read answ

}' <&5 2>&6
~:

and this is the input1 file:
$ more input1
aaaa
bbbb
cccc

and this is the result (I am not seeing the required prompt and I want to)
$ test6
aaaa
bbbb
cccc
 
You are mixing awk and ksh syntax in your awk program !

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top