Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: Re: awk and shell question Keywords: awk sh Message-ID: <3401@star.cs.vu.nl> Date: 27 Sep 89 16:42:17 GMT References: <1163@ispi.UUCP> <1989Sep20.210951.10759@eci386.uucp> <488@diab.se> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 28 gs@diab.se (Greger Sernemar) writes: \... \a="`awk -F: '$1 == NAME { \ user=$5; \ print user \ }' NAME=$LOGNAME - `" \ \The last dash (-) closes standard input i.e enables other program to \pipe to the awk script. How can it pipe into awk when awk's stdin is closed?! A dash doesn't mean CLOSE stdin, it means USE stdin! \I was forced to either supply a file name or \a dash to be able to set the awk variable. \I'm not sure if this is a bug in the version of awk I'm using or not. This is a bug indeed, present in SunOS 4.0.1 awk too. Other bugs: % awk -F '{print}' awk: can't open {print} % awk -F awk: no argument for -f % -- `I AM NEW HEAR AMD I WANT TO INKRIMENT A |Maarten Litmaath @ VU Amsterdam: VURIABLE BY 1 (OONE) IN "c"' (Tom Neff) |maart@cs.vu.nl, mcvax!botter!maart