#These two just exit after this command $result = `ssh-copy-id -i $path_publick_key $user\@$server 2>/dev/null < "$password"`; $result = `ssh-copy-id -i $path_publick_key $user\@$server 2>/dev/null < "$password\n"`; #This gives a password prompt, without me printing the $result, which makes me think, that ssh is using some named output device, instead of stdout. #$result is empty: $result = `echo "$password"|ssh-copy-id -i $path_publick_key $user\@$server 2>/dev/null`;