problem to running command from perl
Dear all,
I'm trying to run the following command using perl $SCHRODINGER/run rmsd.py -asl "not atom.element H" filename1.mol2 /mml/nfs04/reginap/renamed/filename2.mol2 this command works perfect from linux, however when I try to execute it from perl $cmd = "$SCHRODINGER/run rmsd.py -asl "not atom.element H" filename1.mol2 /mml/nfs04/reginap/renamed/filename2.mol2"; $rmsd = system($cmd); I'm getting the following error: syntax error at calc_RMSD_withShrodinger.pl line 22, near ""$SCHRODINGER/run rmsd.py -asl "not " Execution of calc_RMSD_withShrodinger.pl aborted due to compilation errors. I tried different ways like putting \ before "not" and using `` instead of system but nothing worked. I will appreciate very much any help. Thanks Regina |
You're quoting is confused perhaps because you're using double quotes within double quotes.
Maybe using single quotes around the whole command: $cmd = '$SCHRODINGER/run rmsd.py -asl "not atom.element H" filename1.mol2 /mml/nfs04/reginap/renamed/filename2.mol2'; Or escaping the internal set of double quotes: $cmd = "$SCHRODINGER/run rmsd.py -asl \"not atom.element H\" filename1.mol2 /mml/nfs04/reginap/renamed/filename2.mol2"; |
I'd use single quotes here, as it's an absolute string (no vars)
Code:
"not atom.element H" |
All times are GMT -5. The time now is 04:15 PM. |