It used to be that which started out as:

#! /usr/bin/csh

At some later time it changed to:

#! /usr/bin/csh -f

Now I see that there is an explicit sourcing of the .cshrc, undoing
the benefit of -f.

$ grep source /usr/bin/which
if ( -r ~/.cshrc && -f ~/.cshrc ) source ~/.cshrc

which should do something (e.g. use an environment variable) to
prevent recursion.

Mike

On Fri, Jul 11, 2008 at 9:58 AM, Daniel Templeton <[EMAIL PROTECTED]> wrote:
> So, correct me if I'm wrong, but shouldn't csh -f ignore the $HOME/.cshrc
> file?  That totally explains the non--f behavior I was seeing, though, as
> James also pointed out.
>
> Thanks,
> Daniel
>
> Mike Gerdts wrote:
>>
>> On Fri, Jul 11, 2008 at 12:38 AM, Daniel Templeton
>> <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Hi.  I'm trying to build the SFW consolidation on Nevada, but I'm running
>>> into a nasty issue, and I need a sanity check about it.  When I run (or more
>>> probalematicallly, when configure runs) "csh -f /usr/bin/which which", I
>>> basically get a fork bomb:
>>>
>>>
>>>>
>>>> ps | wc -l
>>>>
>>>
>>>      3
>>>
>>>>
>>>> date
>>>>
>>>
>>> Thu Jul 10 22:16:26 PDT 2008
>>>
>>>>
>>>> csh -f /usr/bin/which which &
>>>>
>>>
>>> [1] 9481
>>>
>>>>
>>>> ps | grep which | wc -l
>>>>
>>>
>>>   2341
>>>
>>>>
>>>> date
>>>>
>>>
>>> Thu Jul 10 22:16:49 PDT 2008
>>>
>>> Every which forks off another which, that forks off another which, ad
>>> nonswapeum.  I've tried it both with 79a and 91 (different slices of the
>>> same FS).  I need a sanity check here.  Can anyone else reproduce this
>>> issue?
>>>
>>> Thanks,
>>> Daniel
>>>
>>
>> Does your ~/.cshrc call which?  One of the first thing that which does
>> is source your .cshrc.  which is a bad, evil, misleading command.  It
>> doesn't tell you about your current environment (which may be
>> different than defined in ~/.cshrc) especially if your shell is
>> something decent (anything but *csh).
>>
>>
>



-- 
Mike Gerdts
http://mgerdts.blogspot.com/
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to