Abstract command sending with a function.
Unset PS2 for scripts as it makes output uglier.