Originally posted by chii-chan
I can't get these to work though:
eval "sed -e s/$txt_ori/$txt_rplc/g $text > text.out"
This may or may not work, depending on the contents of the values of the variables you are quoting.
If any of them contains a space, this will create a new parameter, which probably isn't what you want. If they contain <chevrons>, then you will start a file redirect. If they contain a pipe (|) then you will start a file redirect.
If you run
then you can read all about how and when BASH copes with special characters. For example:
eval [arg ...]
The args are read and concatenated together into a single command. This command is then read and exe_cuted by the shell, and its exit status is returned as the value of eval. If there are no args, or only null arguments, eval returns 0.