A reasonably safe way to do what you are trying to do is to run both commands in a subshell. It should work in sh and csh. You do something like this: (stty 4800; cat) < /dev/ttyxx > blechen