On Sunday 18 October 2009 16:06:38 Kevin O'Gorman wrote:
> This may be OT, inasmuch as it's not gentoo-specific.  It's here because my
> system runs Gentoo and I don't know where else to ask.  If it annoys, just
> point me in the right direction to where it will not be OT, please.
> 
> I'm trying to write scripts to help me grade student submissions in a
> systems programming course.  Students are just learning about malloc/free
> and some are floundering.  I'm seeing lots of errors that are caught by
> glibc (with some help from compiling with -D_FORTIFY_SOURCE=2), but I would
> like instead to capture those messages in a file.  It appears that glibc
> does not use stdin or stderr for these messages, since I cannot redirect
> them.  I suspect they are being sent to /dev/tty.
> 
> Is there any wizardry that would allow capture of these messages?  I know
> that somehow the script(1) command captures such stuff, but it's not
>  useable since I want all of this scripted and ironically script(1) does
>  not seem to play nice with scripts.  I also know that this is about to tip
>  me into the abyss of session leaders and controlling terminals, but I'll
>  try to be brave.


My first thought was way out on left field:

could you use syslog-ng to read /dev/tty?

-- 
alan dot mckinnon at gmail dot com

Reply via email to