> From: "David" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Subject: Re: Setting up sftp. > Date: Fri, 3 May 2002 03:03:56 +0800 > > Hi Ed, > > First of all, yes! You guess correctly. My error message was "Received > message too long". I followed your suggestion and found the problem to be my > .bashrc file in which I did echo something. That's causing the corruption. > However, now the problem is that I want to echo that thing and still be able > to get sftp working. Is there a way to achieve that? I am looking for a way > for the script to detect the presence of an actual tty before echoing. Is > that possible? > > Thanks for your help, > David
Well, one common way to do this is to use the presence/absence of a prompt string to distinguish between interactive and non-interactive shells. You can check $prompt in csh/tcsh-type shells or $PS1 in sh/bash-type shells. You could have the echo set up something like this: if [ "$PS1" != "" ]; then echo "your string goes here" ; fi -- pete peterson Teradyne, Inc.; 7 Technology Park Drive; Westford, MA 01886-0033 +1-978-589-7478 (Office); +1-978-589-2088 (FAX); [EMAIL PROTECTED] or [EMAIL PROTECTED] _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list