I am trying to run a bsub command from a perl script in the following way:
system ("bsub -select "testid::1" -q normal");
but I think perl is getting confused because of the double quotes in "testid::1"
. What is the proper way to implement this?
You can escape the inner quotes:
system ("bsub -select \"testid::1\" -q normal");
or replace the outer quotes with single quotes, or in fact any character at all, thanks to the qq
generalized quote operator in Perl which exists precisely for this sort of scenario;
system (qq{bsub -select "testid::1" -q normal});
There is a companion generalized single quote operator q
.