I'm trying to Preserve Interpretation in Bash Variable.
Example
when I run the following line at command prompt.
rm aaa 2>> error_file ; echo '<br><br>' >> error_file
I get the following (which is what I want):
rm: cannot remove `aaa': No such file or directory
If I put the error handling code in a variable it blows-up.
ERROR_HAN="2>> error_file ; echo '<br><br>' >> error_file"
rm aaa $ERROR_HAN
rm: cannot remove `"2>>"': No such file or directory
I have tried quoting a number of ways but no luck. I can't seem to Preserve Interpretation for the 2>>
portion of the variable.
Use
eval
: