slightly tricky way of capturing additions to a logfile

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Aug 13 17:59:49 UTC 2013


On Tue, Aug 13, 2013 at 11:04:03AM -0400, Randy Jonasz wrote:
> Interesting.  But I get the following error when trying these commands:
> 
> root at Nietzsche:/home/rjonasz# exec &{log}< /var/log/syslog
> [1] 5980
> [1]+  Done                    exec
> 
> root at Nietzsche:/home/rjonasz# cat <&${log} >/dev/null
> bash: ${log}: ambiguous redirect
> 
> [1]+  Stopped                 cat
> root at Nietzsche:/home/rjonasz# cat <&"${log}" >/dev/null
> bash: "${log}": Bad file descriptor

Does this do anything you don't get from 'tail -F -n 0 /var/log/syslog'?
Of course using tail solves the log rotate problem too.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list