bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syslog output from bash


From: Bob Proulx
Subject: Re: Syslog output from bash
Date: Tue, 23 Aug 2016 00:08:48 -0600
User-agent: Mutt/1.5.24 (2015-08-30)

Richard Lohman wrote:
> Problem is, I'd like the output to resemble other syslog messages:
>   Mmm dd HH:MM:SS hostname bash[pid]: command
> And ultimately drop the username in as well. Since only bash is logging in

I suggest using the 'logger' command instead of modifying bash.

Normally I am doing things like this:

  logger -t cmdname "my log message here"

But you can get the format you wish with:

  logger -t "cmdname[$$]" "your log message here"

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]