On 1/15/06, Martin Costabel <[EMAIL PROTECTED]> wrote:
> Alexander K. Hansen wrote:
> > On 1/13/06, david <[EMAIL PROTECTED]> wrote:
> >> Why does Fink recommend that I set the path in files that only are read
> >> when I do an interactive login?
> >>
> >> I have installed, for example, fink's rsync but if I use the default
> >> setup for fink the rsync included in Mac OS X is used for
> >> non-interactive sessions rather than the fink version.
>
> What examples of "non-interactive sessions" do you have in mind? I don't
> even know what this is, "session" sounds pretty interactive to me.
> Anyway, the distinction is not between interactive and non-interactive,
> but between login and non-login shells. Interactive/non-interactive
> concerns the question whether stdin and stdout are connected to
> terminals. Login/non-login concerns the question of reading startup
> scripts. PATH is usually set in a login shell, and /sw/bin/init.sh is
> sourced in login shells.
>
> >> Why is it setup like this? It doesn't make sense in my eyes.
> >>
> >> Googling didn't come up with an explanation so I appreciate any input.
> >>
> >>
> > Good question.  I don't know the answer.  ;-)  I actually set my
> > environment in .bashrc, so that non-interactive operations (e.g.
> > X11.app) know about it.
>
> Since when is X11.app non-interactive?

I misspoke--cut me a little semantic slack here.  I should have said
"non-login-shell operations".

The fact that Apple ships it with
> a bad configuration and it doesn't read the right startup files is
> perhaps a reason to try some ugly hacks, but it shouldn't be a reason to
> obliterate the distinction between login and non-login shells in
> general. Or between interactive and non-interactive shells, for that
> matter: As "man bash" explains, ~/.bashrc is read by *interactive*
> shells that are not login shells. If you start a non-interactive,
> non-login shell, then by default *no* startup script is read at all.
>
> This has been discussed many times, and I know that some people are not
> convinced, but I still think it is wrong to source /sw/bin/init.sh
> automatically in every subshell. After all, you start your subshell
> always inside an interactive environment, and environment variables like
> PATH are meant to be transmitted to subshells, so it is sufficient to
> run /sw/bin/init.sh once at startup (hence "login") of the interactive
> environment in which your non-login shell is started. If you need a
> different environment in your subshell, then define it there.
>
> --
> Martin
>
>

I'm just stating my own choice here--this is not intended to be a
policy statement.  In my own case I need X11.app to recognize my
environment customizations, Fink's and otherwise, and this was the
simplest way.  I personally don't do anything where the distinction
matters, but, indeed, this may not apply to everybody.

--
Alexander K. Hansen
Fink Documenter
[Day Job] Levitated Dipole Experiment
http://psfcwww2.psfc.mit.edu/ldx/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to