Thanks for your reply. I wasn't aware that remoteOpen was a shell script… I could debug. The problem is that I cannot have an ssh connection using public keys with the remote server I use. So the “scp -Bpq "${remLoc}" "${localfile}"” part fails.