Author: Jan SchmidtJan Schmidt
Date: Dec 13, 2006 03:24
Hallo zusammen,
ich schaffe es nicht, ein beliebiges "perl -e"-Kommando einer
Shell-Variablen zuzuweisen und diese dann in Backticks auszuführen. Ich
bin mir noch etwas unsicher, ob es sich tatsächlich um ein Perlproblem
handelt. Zwei Indizien sprechen meiner Ansicht nach dafür: 1. Es gibt
eine Perl-Fehlermeldung, 2. Mit einem einfachen anderen Programm
funktioniert es.
Zum besseren Verständnis mal ein paar Beispiele:
$ t="perl -lwe 'print 1'"; echo $t; echo `$t`
perl -lwe 'print 1'
Can't find string terminator "'" anywhere before EOF at -e line 1.
$ t="perl -lwe print\ 1"; echo $t; echo `$t`
perl -lwe print\ 1
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
$ t="perl -lwe print\\ 1"; echo $t; echo `$t`
perl -lwe print\ 1
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
|