I have a script in which I distribute directories to host.  I use
either rdist or scp based on their OS. For example older sun machines
need rdist while newer machines can use scp.  For some reason the
function below only resorts to scp.  what I would like to do is an if/
then statement.  I know in ksh you can use $? to check if the command
was sucessful - anything similiar in perl?

All the variable such as $args, $srcdir, etc are already predefined
via variables.  I am just including the area where I am having an
issue.
...{
                                if ($host eq $hostname) {next;}
                                {$cmd="/usr/bin/rdist $args $srcdir $
{host}:$destdir 2>&1";}
                                else {$cmd="/usr/local/bin/scp
$scpargs $srcdir ${host}:/ 2>&1"; }
                        }


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to