On 6/3/12 4:25 AM, Pierre Gaston wrote: > I thought I was not documented (before 4 it was a bit less obvious > to find the relevant bit) that's why I gave the link, but it is in > fact documented. > Eg in the bash 4 manual: > > Bash attempts to determine when it is being run with its > standard input connected to a network connection, as when > executed by the remote shell daemon, usually rshd, or the > secure shell daemon sshd. If bash determines it is being > run in this fashion, it reads and executes commands from > ~/.bashrc and ~/.bashrc, if these files exist and are > readable. > > If I'm not mistaken this feature is inherited from csh. I can > guess some people are using it since there is this workaround > testing for the SSH variables to make it work with openssh>5.
That's not exactly it, but the idea is right. isnetconn() (previously issock()) has been around since bash-1.13. If I had to guess, I'd say late August 1992 or 1993. It wasn't inherited from csh. The original requests were along the lines of having something to set the remote environment when running rsh or rcp. As you can see, this long predates ssh. As ssh became more popular, there were different ways to accomplish the same thing (e.g., put BASH_ENV=startup-file into ~/.ssh/environment), but there were still requests to leave the feature in bash. It's still there today. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/