passing command line arguments

carroll at snail.CS.UIUC.EDU carroll at snail.CS.UIUC.EDU
Mon Sep 22 22:41:00 AEST 1986


On System V, I could pass things to awk by putting "var=value" stuff on
the command line. For example, I wanted awk to return everyone in a
certain group in a script, and the group was not known to the script:
awk -F: '$4 == group { print $1 }' group=$group /etc/passwd
where $group was a shell variable. This is supposed to work under 4.2BSD
also (according to the manual), but I seem to remember having trouble
with it.



More information about the Comp.unix mailing list