STDIN, STDOUT, STDERROR Redirection for scripting
Hi there,
I'm writing a script to execute bash commands in the PHP CLI. I would like to suppress errors from bash and write my own error message if an error occurs. So far I have this (assuming log.txt doesn't exist!): Code:
tac log.txt 2>/dev/null Code:
tac < log.txt 2>/dev/null Code:
bash: log.txt: No such file or directory Does anyone know how to suppress this? |
Code:
(tac < log.txt) 2>/dev/null |
Much appreciated! Thanks.
|
All times are GMT -5. The time now is 06:11 PM. |