sftp with a user defined shell

John Davidorff Pell johnpell at mac.com
Thu Aug 19 17:41:33 EST 2004


in bash, you can check if the variable $- includes the letter i in it. 
If it does, then its interactive. If you check the man page for your 
shell, it should tell you how to determine if it is interactive. It is 
likely something similar. For example, in many shells you can check if 
the prompt variable is set ($PS1 in bash).

You can also check if stdout is a tty. If it is interactive, it almost 
certainly is, and if it is not, then it almost certainly is not. 
(though both are possible.) I just noticed that you said your shell 
requires a tty... Why?

You said your shell was "rc"? take a look at 
http://www.star.le.ac.uk/~tjg/rc/ There is also a mailing list that you 
can ask on for the specifics of your shell and how to tell if it is 
interactive.

May I ask why you have output from the shell anyway?

JP

P.S. I've cc'd the list again. :-)

On 18 Aug 2004, at 09:40, Srinivas Gopaladasu wrote:
> I am not sure how I find out if the shell is launched interactively or 
> non-interactively?
>
> John Davidorff Pell wrote:
>> the shell is broken, or the user's rc files are broken. A shell 
>> should not output any text if it is run as non-interactive.
>>
>> On 17 Aug 2004, at 12:46, Srinivas Gopaladasu wrote:
>>> [...]
>>> the sftp client bails out saying the following message:
>>> "Received message too long 537548147"
>>>
>>> Is it because the user shell, outputting lot of text?
>>> [...]
>>> As my_sh needs a tty and because of a bug in that, it runs in a 
>>> while loop and takes up lot of cpu.
>>> [...]

--
Blood is thicker than water... and much tastier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2426 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20040819/2df1979e/attachment.bin 


More information about the openssh-unix-dev mailing list