shell scripting error logging

Posted by Eddy on Stack Overflow See other posts from Stack Overflow or by Eddy
Published on 2010-06-08T16:50:01Z Indexed on 2010/06/08 16:52 UTC
Read the original article Hit count: 146

Filed under:
|
|

Hi all,

I'm trying to setup a simple logging framework in my shell scripts. For this I'd like to define a "log" function callable as

log "LEVEL" $message

Where the message is a variable to which I have previously redirected the outputs of executed commands. My trouble is that I get errors with the following

{message=command 2>&3 1>&3 3>&-} >&3 log "INFO" $message

There's something wrong isn't there?

TIA

© Stack Overflow or respective owner

Related posts about shell

Related posts about scripting