Help for this page

Select Code to Download


  1. or download this
    # Get list of remote files
    my @remote_files= qx(ssh $uid $h 'find $dirname');
    
  2. or download this
    # Munge filenames to commands:
    my @commands= map { sprintf "mv -i '%s' '%s.bak'",
                                  quotemeta($_), quotemeta($_)
                      } @remote_files;
    
  3. or download this
    # Send list of commands to the remote side:
    # First, a dry-run instead of actually doing that:
    ...
    # Use this to actually do the remote execution:
    #open $remote, "| ssh -q -l $uid $h";
    print { $remote } join "\n", @commands;