Doubt regarding using "exec" command to redirect the STDERR to a file. e.g I did it this way.
mystage.sh
#!/bin/sh exec 2>stage.err
....
....
cat stage.err
mv: cannot move `/root/stage' to a subdirectory of itself, `/root/stage_old/stage'
ls: *.zDB: No such file or directory
................
Now I want to add some timestamp details and some line indetations for this error log along with the redirection.
How should I do that ? Is there any method for that ?
Can you help me out. I want the error file to be as below
cat stage.err
Timestamp :30-06-08-01:39:10
mv: cannot move `/root/stage' to a subdirectory of itself, `/root/stage_old/stage'
Timestamp :30-06-08-01:39:12
ls: *.DB: No such file or directory
Kindly help me in this regard !!!
Thanks
Shankar