I need to execute the following code on a bash shell:
mogrify -resize 800x600 *JPG
Since the width and height are variables, I tried this:<
In addition to the other good responses, you can also use the readpipe function, which is equivalent to backticks and the qx operator. But like a regular function, you can exercise greater control over how the arguments to it are interpolated.
$output = readpipe("mogrify -resize $wid" . "x$hit *.JPG");
$output = readpipe( sprintf "mogrify -resize %dx%d *.JPG", $wid, $hit );