Getting return value in os.system rsh call

Mike Meyer mwm at
Thu Jan 30 17:23:16 CET 2003

migmog99 at (Andrew) writes:

> DUH.... Erik, I should have read more closely.....
> ... I need the slash. Then it works. The thing is I've never been
> completely happy with my understanding of Unix quoting.
> Can anyone explain why putting the slash in makes a difference?

Because variables inside "'s are expanded. So it's expanding it in the
command line on this side instead of passing it to the remote
shell. Backquoting it passes the $ sign to the remote shell, which
then expands it.

> Also, how do I get rid of the stty error messages?

Those are coming from your .shrc, or .bashrc, or whatever rc files
your shell uses. At least, you hope they are coming from those, and
not the system rc files for your shell. You need to put the two stty
invocations in a test like so:

if [ test -t 0 ];
    stty <stuff>
    stty <stuff>

or, maybe

if [ tty -s ];
    stty <stuff>
    stty <stuff>

You may have to check more than one rc file to find them all.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list