Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!nike!lll-crg!lll-lcc!pyramid!ucat!scc!steiny From: steiny@scc.UUCP (Don Steiny) Newsgroups: net.unix Subject: Re: passing command line arguments to awk Message-ID: <732@scc.UUCP> Date: Wed, 24-Sep-86 00:16:42 EDT Article-I.D.: scc.732 Posted: Wed Sep 24 00:16:42 1986 Date-Received: Wed, 24-Sep-86 09:09:35 EDT References: <731@scc.UUCP> <482@ms3.UUCP> Distribution: net Organization: Don Steiny Software Lines: 27 In article <482@ms3.UUCP>, msitd22@ms3.UUCP (Jim Chappell) writes: > In article <731@scc.UUCP>, steiny@scc.UUCP (Don Steiny) writes: > > In article <753@moscom.UUCP>, de@moscom.UUCP (Dave Esan) writes: > > > > > > > > I surrender -- is it possible to pass command line arguments to awk? > > > > If so - how. > > > > awk 'statement ; . . . ' file > > > > be sure and use single quotes! Lots of awk characters have > > special meaning to the shell. The following prints the uids in > > the password file from highest to lowest: > > > > awk -F: '{ print $3 }' | sort -n -r > > I bet it sits there forever more because of missing input, > Right! . . . and then I go . . . "oops" and type awk -F: '{ print $3 }' /etc/passwd | sort -n -r -- scc!steiny Don Steiny @ Don Steiny Software 109 Torrey Pine Terrace Santa Cruz, Calif. 95060 (408) 425-0382