PolyAwk - AWK question
Martin J Brown-Jr
MJB at cup.portal.com
Wed May 3 19:10:46 AEST 1989
I just purchased Polytron's Polyshell and Polyawk. While checking out Polyawk
I ran across something that struck me as odd. The following piece of "code"
runs fine and works as expected, accepting all lines except those that begin
with "Command:", and putting the accepted lines in the file d:foo. You will
notice the absence of a input filename, which causes Polyawk to accept the
input from the keyboard.
code follows, enter exactly the same way at the Polyshell prompt:
awk '$0 !~ /Command:*/ { print $0 >"d:foo" }'
The above code works as expected, but when I had an input filename to this
"code", I get a warning that the program will accept and pass on to d:foo
all of the input lines (paraphrasing). At which point, the cursor drops to
a newline and just blinks, doing nothing until I do a control-c, which dumps
me back to the prompt.
here is the modified code that just hangs there:
awk '$0 !~ /Command:*/ { print $0 >"d:foo" } "d:file.txt"'
(note *** quotes were needed around filenames to avoid warnings, I don't
think this was documented is this no
think this was documented. Is this normal for awk?)
Could someone out there explain my error(s)? Would awk react the same way
that PolyAWK is reacting? Any further suggestings/ideas?
Thanx for any help!
- MJB -
More information about the Comp.unix.questions
mailing list