stty: : Invalid argument Using SSH
- From: John Doe <kerrangster@xxxxxxxxx>
- Date: Sat, 27 Sep 2008 09:19:26 -0700 (PDT)
In a script, I was using SSH to run a command on a remote server. I
got the message "stty : : invalid argument." It took me a while to
figure out why. An interactive shell reads commands from user input on
a tty. If you're executing ssh inside a script to run a command on
another server, ssh logs into the server as a specific user, and
executes the command on the server in a non-interactive shell.
Command shells in the sh family execute ~/.profile and ~/.bash_profile
once at login, and ~/.kshrc and ~/.bashrc when ever a new shell
starts. Command shells in the csh family execute the ~/.login on
login, and the ~/.cshrc when ever a new shell starts. When a user logs
into a server the shells reads these initialization files: ~/.kshrc,
~/.bashrc, or ~/.cshrc followed by the ~/.profile, ~/.bash_profile or
~/.login depending on the shell.
..profile, .bash_profile, .login: used to identify the terminal and set
the erase character
..cshrc, .kshrc, .bashrc: used to set shell variables and aliases
If you see "stty : : Invalid Argument," it means your ssh command
logged into the remote server (non-interactive) and initialized the
shell, but encountered stty in one of the scripts above. It's a non-
interactive shell, there is no control terminal.
Look in the scripts mentioned above for a stty. You'll find it because
this is why you're getting the "stty : : Invalid Argument." You can
remove the line, or check for interactive or non-interactive:
if [ -t 0 ]; then
echo interactive
stty erase ^H
else
echo non-interactive
fi
-t fd - True if file descriptor fd is open and refers to a terminal
.
- Follow-Ups:
- Re: stty: : Invalid argument Using SSH
- From: S P Arif Sahari Wibowo
- Re: : Invalid argument Using SSH
- From: Joachim Schmitz
- Re: stty: : Invalid argument Using SSH
- Prev by Date: hentai naruto hentai pokemon hentai bleach hentai hentai games - Online
- Next by Date: Re: Automating ssh connection
- Previous by thread: hentai naruto hentai pokemon hentai bleach hentai hentai games - Online
- Next by thread: Re: : Invalid argument Using SSH
- Index(es):
Relevant Pages
|