$INVALID_STRING="!"$\%&'()*/@`~"; $STRING_TO_EXECUTE="java myprogram -opt1 ABC -opt2 $INVALID_STRING"; @output=`$STRING_TO_EXECUTE 2>&1`; #### sh: -c: line 1: unexpected EOF while looking for matching ``' sh: -c: line 3: syntax error: unexpected end of file