I use logger command to log messages to /var/log/messages But How do I use logger to save the standard out, error out messages? Something like this does not work.
grep `date +'%y%m%d'` /var/log/mysqld.log | sed 's/^/computer /' | logger 2> logger
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re confusing redirection to a process (pipes, or
|) with redirection to a file (>).You need to redirect stderr to stdout by using
2>&1, and then pipe (|) to your logger process.e.g.
This assumes you’re using
shor a variant. The syntax is different forcsh. It’s worth having a look at this excerpt from Unix Power Tools for more info (especially as your previous question seems strongly related).