write statement into one file

I have one file name start.sh in rinku directory. I want to move it to rinku1 directory. I also mantain log file. In the log file I want to write the the statement whenever the move is failed.
Example:
>echo `mv /rinku/me.tx ../rinku1` | tee -a log1
mv: me.tx: cannot access: No such file or directory

I want to write mv: me.tx: cannot access: No such file or directory into log1.

It is not working. I am working in ksh.

Please help.
Thanx in advance.......:slight_smile:

mv /rinku/me.tx ../rinku1 2>> log1

can't I use tee instead of >>. bcoz with this command mv: me.tx: cannot access: No such file or directory this line is not shown during runtime. I have to show it in runn time also.

please suggest.

Where there is no such file a100

mv a100 a200 2>&1 | tee -a filename.log

Will display in stdout and file

It is working. Cloud u please explain the meaning of 2>&1

Thanx .....

Redirect output of stderr (2) to where stdout (1) is redirected