Uri Guttman wrote:
"ET" == Ezra Taylor<ezra.tay...@gmail.com>  writes:

   ET>  Hello All:
   ET>                  My rsync options are not being recognized in the system
   ET>  function.  I tried escaping the asterisks and single quotes to no avail.
   ET>  Also, I do not want to install any rsync modules.  Your help will be 
much
   ET>  appreciated.   Thanks.


   ET>  my $RSYNC_OPTS=' -auvr --include='*/' --exclude='*' ';

that isn't valid perl. is that the actual line you used? you can't put
single quotes inside a string delimited with single quotes. the best way
is to use the q operator and choose a different delimiter. also use
white space around the =.

        my $RSYNC_OPTS = q{ -auvr --include='*/' --exclude='*' } ;

   ET>  system("$RSYNC", "$RSYNC_OPTS",  
"$host:/Blah/blah/Blue/$host_env/$cluster","/tmp/$host");

there is not need to quote scalar vars like that. in fact it could lead
to a bug in some situations.

The real problem is that $RSYNC_OPTS contains whitespace and you can't mix system(LIST) and system(STRING) together like that. It has to be either:

system($RSYNC, split( ' ', $RSYNC_OPTS ), "$host:/Blah/blah/Blue/$host_env/$cluster", "/tmp/$host");

Or:

system("$RSYNC $RSYNC_OPTS $host:/Blah/blah/Blue/$host_env/$cluster /tmp/$host");



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to