How to execute a remote command and pass in local file as input?@Gilles: I think the original title was misleading, and you understood his question based on the misleading title. As far as I can tell, thought, he didn't actually want to act on the local file, but just pass it in as input. (But your answer is amazing, if I understand it correctly! Maybe I should ask the question you answered, just to give you a place to put the answer where you'll get proper credit for it.) I've edited the questions title to make it consistent with the body and with the chosen answer.