eitan@mlacus.oz (Eitan Froumine) (02/06/91)
Is it possible to "print" from awk to the stderr? -- = _ ___ _ _ = ___ ___ = eitan@mlacus.oz{.au} = / / / / /\__/ = /__ . _/ _ _ /__ == Ph: +61 3 550 1688 = / __/ / / \ = /__ / ( (_( ( ( / === FAX: +61 3 550 1599 === / == Eitan Froumine ======= Australian Centre for Unisys Software =========
toad@rubikon.UUCP (Peter Cleve) (02/09/91)
eitan@mlacus.oz (Eitan Froumine) writes: >Is it possible to "print" from awk to the stderr? The standart (and portable) solution is : print "foo bar" | "cat 1>&2" In nawk (comes with newer unix releases) or with gawk you can try : print "foo bar" > /dev/stderr This solution does not have the overhead of starting a new process for every burst of output. By -- Peter Cleve | SUB : toad@rubikon 3014 Laatzen 3 (Rethen) | ...!tmpmbx!mcshh!veeble!rubikon!toad Hildesheimer Str. 316 | Tel. 05102/1854 (Voice)
tchrist@convex.COM (Tom Christiansen) (02/09/91)
From the keyboard of toad@rubikon.UUCP (Peter Cleve): :>Is it possible to "print" from awk to the stderr? : :The standart (and portable) solution is : : print "foo bar" | "cat 1>&2" :In nawk (comes with newer unix releases) or with gawk you can try : : print "foo bar" > /dev/stderr You can only do that if you the system itself supports /dev/stderr, not awk. And the syntax really should be: print "foo bar" > "/dev/stderr" I would say there are a LOT of systems that don't support both nawk and /dev/stderr. But I guess it's nice if you have it. --tom -- "All things are possible, but not all expedient." (in life, UNIX, and perl)
david@cs.dal.ca (David Trueman) (02/10/91)
In article <1991Feb09.065958.22874@convex.com> tchrist@convex.COM (Tom Christiansen) writes: |From the keyboard of toad@rubikon.UUCP (Peter Cleve): |:>Is it possible to "print" from awk to the stderr? |: |:The standart (and portable) solution is : |: print "foo bar" | "cat 1>&2" |:In nawk (comes with newer unix releases) or with gawk you can try : |: print "foo bar" > /dev/stderr | |You can only do that if you the system itself supports /dev/stderr, Gawk fakes the support. |not awk. And the syntax really should be: | | print "foo bar" > "/dev/stderr" Right. -- {uunet watmath}!dalcs!david or david@cs.dal.ca
cliff@demon.co.uk (Cliff Stanford) (02/11/91)
In article <1991Feb09.065958.22874@convex.com> tchrist@convex.COM (Tom Christiansen) writes: >From the keyboard of toad@rubikon.UUCP (Peter Cleve): >: print "foo bar" > /dev/stderr > >You can only do that if you the system itself supports /dev/stderr, >not awk. And the syntax really should be: > > print "foo bar" > "/dev/stderr" gawk (gnu awk) fakes it so that print string > "/dev/stderr" works even under MsDos. Cliff. -- Cliff Stanford Email: cliff@demon.co.uk (Work) Demon Systems Limited cms@demon.co.uk (Home) 42 Hendon Lane Phone: 081-349 0063 (Office) London N3 1TT England 0860 375870 (Mobile)
jim@segue.segue.com (Jim Balter) (02/11/91)
In article <785@rubikon.UUCP> toad@rubikon.UUCP (Peter Cleve) writes: |The standart (and portable) solution is : | | print "foo bar" | "cat 1>&2" | |In nawk (comes with newer unix releases) or with gawk you can try : | | print "foo bar" > /dev/stderr | |This solution does not have the overhead of starting a new process for |every burst of output. Nor does the "standard solution". Try awk '{print | "wc"}' somefile. awk keeps a table of the filenames and commands it has opened and only does the open/popen the first time a particular filename or command is encountered.
rob@b15.INGR.COM (Rob Lemley) (02/14/91)
In <785@rubikon.UUCP> toad@rubikon.UUCP (Peter Cleve) writes: >>Is it possible to "print" from awk to the stderr? > print "foo bar" | "cat 1>&2" >In nawk (comes with newer unix releases) or with gawk you can try : > print "foo bar" > /dev/stderr >This solution does not have the overhead of starting a new process for >every burst of output. Neither solution starts a new process for EVERY burst of output. The first solution starts a process for all output piped to the string "cat 1>&2", no matter how many instances of the string are piped into. The difference is ONE process. Rob --- Rob Lemley 205-730-1546 System Consultant, Intergraph Corporation rob@b15.ingr.com ...!uunet!ingr!b15!rob