Hello,
How do I capture any error from a sed
command into a file? Here is the sed
command I am using:
sed -e 's/'old_word'/'new_word'/' temp_file > output_file
Now, when everything goes well, modified contents from temp_file
are captured in output_file
. But let's say that output_file
happens to be read only. In this case, instead of error being shown on screen , I would like it to be redirected to error_file
. How can I do that? I tried adding 2> error_file
to the end of the above command but that did not work.
Thanks.