quoting - Preserve Interpretation in Bash Variable -


i'm trying preserve interpretation in bash variable.

example

when run following line @ command prompt.

rm aaa 2>> error_file ; echo '<br><br>' >> error_file 

i following (which want):

rm: cannot remove `aaa': no such file or directory 

if put error handling code in variable 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 number of ways no luck. can't seem preserve interpretation 2>> portion of variable.

use eval:

eval rm aaa ${error_han} 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -