Am 20.02.2013 17:14, schrieb Steve Hayes: [...] > > I'm on Windows. On WinDOS always put your awk program[*] in a file, say xyz.awk, and call it using option -f awk -f xyz.awk Ellwood1.ged otherwise you'll get the quoting issues that you describe below and probably other hassles as well. Janis [*] The "awk program" is only the code inside the single quotes. > > Tried it as you suggested, and this was the result: > > H:\>awk '$2 !~ /@.*@/ { sub(/Service/, "S.") } { print $0 }' Ellwood1.ged > > DOSPRN Print Spooler. Version 1.77 > (c) 1990-2004 by Gurtjak D., Ignatenko I., Goldberg A. > Use extended memory: 200K > Use conventional memory: 4K > '$2 > ^ > awk: line 0: syntax error > > H:\>gawk '$2 !~ /@.*@/ { sub(/Service/, "S.") } { print $0 }' Ellwood1.ged > gawk: '$2 > gawk: ^ invalid char ''' in expression > > H:\>gawk $2 !~ /@.*@/ { sub(/Service/, "S.") } { print $0 } Ellwood1.ged > gawk: cmd. line:1: fatal: cannot open file `!~' for reading (No such file or > directory) > > H:\> > > I tried first with an older version of AWK, and later with a newer one (called > gawk above). > > When it said it didn't like the "'" characters, I removed them and tried > again. > >