I'm trying to implement -s
(i.e. silent) option in my script - when given the Errors/Info etc, will be send to the syslog otherwise printing on the screen and also sending to the syslog
at the same time. That's what I'm doing:
echo -e "This Is a Test Message\nWell, not really!!" 2>&1 | logger
to send the echo
message to the syslog
(which doesn't print on-screen) but couldn't just figure out how to do the both at the same time. I see people only talk about either logging with syslog
or sending log to a different file whilst printing on the screen but not the situation that I'm trying deal with. Any help or pointer would be greatly appreciated. Cheers!!