awk vs echo

Peter Jaspers-Fayer SOFPJF at VM.UOGUELPH.CA
Tue Feb 12 03:23:04 AEST 1991


I guess that even after a year of trying, I do not understand the way
the shell (csh) passes things to it's children, viz:

This is an excerpt from a longer awk command, and I'm stuck:

This works
           awk '{ print "'$user': " $0}'
as does
           awk '{ print "'`hostname`': " $0}'
But not
           awk '{ print "'`date`': " $0}'     (Spaces(?) Colons(?))
Even tho
          echo '{ print "'`date`': " $0}'     works OK, and if I CUT&PASTE
the result of the echo into another awk '', something like:

           awk '{ print "Mon Feb 11 11:35:32 EST 1991: " $0}'    IT WORKS!

Why are the last and 2nd-last awks different?  Anyone please?

 /PJ                                                SofPJF at VM.UoGuelph.Ca
         --------------------------------------
How did a fool and his money get together in the first place?       -Anon



More information about the Comp.sys.sgi mailing list