R
rduke15
Hi,
I have a weird problem with this simple bash script calling a Perl
command in a variable. I don't understand what's wrong.
$ cat test.sh
#!/bin/sh
set -x
cmd="perl -e 'print 1+2'"
$cmd
$ ./test.sh
+ cmd=perl -e 'print 1+2'
+ perl -e 'print 1+2'
Can't find string terminator "'" anywhere before EOF at -e line 1.
I also tried all sorts of variations with the quotes, but nothing seems
to work.
Thanks for any help...
I have a weird problem with this simple bash script calling a Perl
command in a variable. I don't understand what's wrong.
$ cat test.sh
#!/bin/sh
set -x
cmd="perl -e 'print 1+2'"
$cmd
$ ./test.sh
+ cmd=perl -e 'print 1+2'
+ perl -e 'print 1+2'
Can't find string terminator "'" anywhere before EOF at -e line 1.
I also tried all sorts of variations with the quotes, but nothing seems
to work.
Thanks for any help...