bash error handling
hi there...
i'm currently working on some error handling in my scripts... for example i tried to get the "permission denied" from on of my scripts (if it fails) to be send in a mail... here is what i'm trying to do... Code:
message="/gfsdisk/scripts/autoresponder.log" here is the mail code: Code:
if i run the script as root... i don't get any permission denied replys... when i run it as a non priviledged user i get a "permission denied" messige, but it'S not written in the log file... what am i doing wrong`? thx a lot |
I am not sure how the above all jells together, but do you understand what the following line is doing?
Code:
true > $file &> $message Code:
echo hello > file1 &> file2 |
as far as i know "ture > $file" makes $file a blank file
and "&> $message" writes the standart output and error message, if there is any in the $message file |
problem solved:
Code:
if [ -f $file ] |
Quote:
As you have your solution though ... good luck |
All times are GMT -5. The time now is 11:28 PM. |