I have tried several ways to connect to remote computer: $SERVER = qx{ssh -o ConnectTimeout=2 -o ControlPersist=yes $user\@$server "sudo hostname| cut -d "." -f1"}; chomp ($SERVER); but commands that have metacharacters, especially the single quote, I can not get to work. I can run the following from perl after ssh connection with single quotes included: $ssh = Net::OpenSSH->new("$user\@$server"); $CMD = "grep -c alias cp='cp -f' /etc/bashrc"; $fh = $ssh->pipe_out($CMD); while (<$fh>) { $OUTPUT .= $_; } chomp ($OUTPUT); and it works. But if add 'sudo' for cases where I need to read a file that the login user does not have permissions for -- I can not get it to work. I have searched and tried a number of recommendations and it either fails with a permission error or locks up or gives grep errors. Thanks in advance, David _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx