I am the originator of this thread.
I finally got hold of a UNIX guru I know
and he suggested the following.
It seems to work with most versions
of awk nawk gawk, etc.
printf "Enter your name: "
system("read a; echo $a") | getline name
print name
I hope this may help...
I need to input data from the keyboard in awk.The only
reference I can find in any of my AWK books is
to do the following:
BEGIN { printf "Enter your name: "
getline name < "-"
print name
}
This was accompanied by the footnote that not all
versions of awk/nawk/gawk/etc...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.