Getting return value in os.system rsh call

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


migmog99 at hotmail.com (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 ];
then
    stty <stuff>
    stty <stuff>
fi

or, maybe

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

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

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list