Interesting $0 Problem

Michael Schuster michaelsprivate at gmail.com
Fri Oct 28 14:43:39 UTC 2016


you may want to run different .-scripts depending on whether you're in a
login shell (once?) or not (every time) ...

On Fri, Oct 28, 2016 at 4:40 PM, Tim Daneliuk <tundra at tundraware.com> wrote:

> 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/
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-
> unsubscribe at freebsd.org"
>



-- 
Michael Schuster
http://recursiveramblings.wordpress.com/
recursion, n: see 'recursion'


More information about the freebsd-questions mailing list