[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: awk



On 14.11.06 16:40:36, Hans-Georg Bork wrote:
> On Tue, 2006-11-14 at 08:08 +0100, Rüdiger Noack wrote:
> > Hans-Georg Bork schrieb:
> > >> 
> > >> holbe@darkside:/home/holbe% echo -n "" | awk 'END { print "Ha!" }'
> > > 
> > > hgb@sokrates:~$ echo -n "" | awk '{ print "Ha!" }'
> > > hgb@sokrates:~$
> > > 
> > > ... und warum geht dies dann nicht, bzw. liefert nix?
> > > 
> > Weil ich das jetzt gelernt habe, die Antwort von mir: :-)
> > 
> > erno@flinker:~$ echo -n "" | awk '{ print "Ha!" }'
> > erno@flinker:~$ echo -n "" | awk 'END { print "Ha!" }'
> > Ha!
> 
> So weit war ich auch, nur warum kommt gar nichts, wenn der END Block da
> nicht steht?

man awk, Abschnitt Patterns. BEGIN/END werden immer ausgefuehrt ohne die
Eingabe zu beachten.

Andreas

-- 
Beauty and harmony are as necessary to you as the very breath of life.



Reply to: