On Sat, 16 Jan 2021 12:24:48 +0000, Pancho wrote:
> I thought << was a way of redirecting stdin, not redirecting command
> line or program file.
>
'man bash' is your friend - look up 'here documents' in the bash manpage
> In fact I couldn't get the following to work at all:
>
> sudo journalctl -f | awk '{ print $0 }'
>
awk is expecting to be passed the awkscript in one of these ways:
1) awk -f sourcefile
2) awk -- 'program text'
and in (2) the '--' which marks the end of awk options, is mandatory
if you use this syntax.
> sudo journalctl -f | awk -- '{ print $0 }'
Since journalctl only reads the systemd journal, if you want to read any
other journal, and /var/log/messages is the default for most non-system
programs you need to use tail, not journalctl, so write something like
sudo tail -f /var/log/messages | awk -- '{ print $0 }'
which works here.
--
--
Martin | martin at
Gregorie | gregorie dot org
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|