[lkml]   [2004]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Redirection of STDERR
    Yeah, you're right.  I was tired when I wrote it,

    however, the exec command still isn't quite
    complete. Normally, you'd want a command to be

    In theory, the exec command by itself should (I think) just
    redirect for the rest of your commands... However, it would
    appear that there's a bug in bash for that syntax.
    (i.e. If I type it in on the command line, It doesn't work for me, either).

    In this case, I think you're going to be better off to just start
    your processes with the output going direct logger...

    my (more successful) way of doing this is:

    command 1
    } | logger -t $0[$$]

    (needs a semicolon before the '}' if it's a one-liner.

    It's also more portable (compatible with old bourne shells)
    I prefer to save things like the named pipe syntax for the really
    ornery situations where bourne-compatible syntax jusr doesn't
    do the job.

    Andreas Schwab wrote:
    > Stephen Samuel <> writes:
    >>Christoph Pleger wrote:
    >>>In my initialization scripts for hotplug (written for bash) the
    >>>following command is used to redirect output which normally goes to
    >>>stderr to the system logger:
    >>>"exec 2> >(logger -t $0[$$])"
    >>I don't remember this syntax as legal.
    > That's the process substitution feature of bash, quite handy when you want
    > to get an fd connected to a pipe.

    Stephen Samuel +1(604)876-0426
    Powerful committed communication. Transformation touching
    the jewel within each person and bringing it to light.
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:01    [W:0.020 / U:14.272 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site