Note you also need to check close for errors, and I would strongly recommend the list form of open. See Calling External Commands More Safely (near the bottom there's example code).
In reply to Re^2: Pass local bash script to remote host via SSH
by haukex
in thread Pass local bash script to remote host via SSH
by puterboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |