in reply to Rename all files on remote server to *.bak recursively

You could leverage find and perl on the remote end.
$remotehost="somehost.tld"; $remotedir="/some/dir/"; $cmd="/usr/bin/ssh $remotehost find $remotedir -type f -print". '| perl -ne \'chomp;$n=$_.q^.bak^;rename($_,$n)\''; print "cmd is [$cmd]\n"; #uncomment after testing #system($cmd);

Replies are listed 'Best First'.
Re^2: Rename all files on remote server to *.bak recursively
by nancylt723 (Initiate) on Jun 06, 2014 at 12:05 UTC
      The cmd is missing the "find /whatever -type f -print|" that should be at the front. Guessing you made some modifications. The perl command is looking for a list of files to be piped to it.