Is it possible to do something to a string so that it gets escaped for a
shell command (i.e. if I'm executing a command and I have the file name
"foo's bar.jpg" it will be escaped to: "foo\'s\ bar.jpg"?  

Right now the following script is giving me problems because whenever
the mv command is executed the file names never get properly escaped.

#! /usr/bin/perl

use warnings;
use strict;

my @output = `ls`;
my $count = 1;

while ($_ = shift @output) {
  chomp $_;
#   print $_, "\n";
#   $_ =~ s/ /\\ /;
  print "mv ./${_} ./${count}.jpg\n" unless $_ =~ /rename.pl/;
  $count++;
}


Thanks in advance,

Dan


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to