Interesting $0 Problem

Tim Daneliuk tundra at tundraware.com
Fri Oct 28 14:41:34 UTC 2016


On 10/28/2016 03:34 AM, Arthur Chance wrote:
<SNIP>

> 
> 
> Prepending a dash to a login shell has been standard behaviour since the
> BSD days at least. I think it was in version 6 of the original Bell Labs
> Unix as well, but after three and a half decades my memories for such
> details are a bit hazy. Anyway, it's a standard marker.
> 


Thanks to all who took the time to answer what turned out to be a really
stupid question on my part.  It's odd that I've never run into this
in over 3 decades of working on *NIX ...

So now, can someone perhaps answer a couple of other really dumb questions:

When is it useful for a script to know it's running in a login context vs.
a child of the login shell?

Is there another way to determine if your current shell is the login shell?

This is more intellectual curiosity than anything ...


----------------------------------------------------------------------------
Tim Daneliuk     tundra at tundraware.com
PGP Key:         http://www.tundraware.com/PGP/



More information about the freebsd-questions mailing list