slightly tricky way of capturing additions to a logfile

Randy Jonasz rjonasz-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Aug 13 15:04:03 UTC 2013


On Tue, Aug 13, 2013 at 1:03 AM, D. Hugh Redelmeier <hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org> wrote:
> Background (can be skipped):
>
> I'm having problems with grub.
>
> Ubuntu has a bug where it won't add grub entries for other installed
> linuxes UNLESS their /boot is mounted.  The fix is upstream (debian)
> for six months or so but they haven't shipped it (althuogh it is
> marked as "fix-released"):
> <https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1038093>
>
> Fedora had a similar bug.  They wouldn't add grub entries for other
> installed Linuxes unless the partition with /boot had SELinux security
> labels.  Rather a rude requirement considering those labels don't do
> Ubuntu any good.  That one has been fixed:
> <https://bugzilla.redhat.com/show_bug.cgi?id=882568>
>
> So I found a similar-looking bug in Fedora-19 on the weekend and
> misdiagnosed it <https://bugzilla.redhat.com/show_bug.cgi?id=995777>
> I don't yet know what the bug is.
>
> The Red hat maintainer(?) asked me to run os-prober, the thing that is
> supposed to find other operating systems when generating a grub config
> file (unless grubby is being used).  He wanted to see what was logged
> to /var/log/messages
>
>
> Foreground:
>
> Here are the slightly tricky shell commands I used:
>
> [root at redcherry-mimosa-com hugh]# exec {log}</var/log/messages
> [root at redcherry-mimosa-com hugh]# cat <&${log} >/dev/null
> [root at redcherry-mimosa-com hugh]# cat <&${log}
> [root at redcherry-mimosa-com hugh]# os-prober
> /dev/sda1:FreeDOS:FreeDOS:chain
> [root at redcherry-mimosa-com hugh]# cat <&${log}

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


Randy
--
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