From owner-freebsd-questions@freebsd.org Fri Oct 28 14:41:34 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9C88C24B32 for ; Fri, 28 Oct 2016 14:41:34 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from oceanview.tundraware.com (oceanview.tundraware.com [45.55.60.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "oceanview.tundraware.com", Issuer "oceanview.tundraware.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A22A59F5 for ; Fri, 28 Oct 2016 14:41:34 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from [192.168.0.2] (ozzie.tundraware.com [75.145.138.73]) (authenticated bits=0) by oceanview.tundraware.com (8.15.2/8.15.2) with ESMTPSA id u9SEf2dl006281 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 28 Oct 2016 09:41:02 -0500 (CDT) (envelope-from tundra@tundraware.com) Subject: Re: Interesting $0 Problem References: <516bc76f-f14c-e9a5-a246-2e915a5369ce@qeng-ho.org> To: FreeBSD-Questions From: Tim Daneliuk Message-ID: <5a4f0424-cdfa-bd44-9de2-b4860d121584@tundraware.com> Date: Fri, 28 Oct 2016 09:40:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <516bc76f-f14c-e9a5-a246-2e915a5369ce@qeng-ho.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (oceanview.tundraware.com [45.55.60.57]); Fri, 28 Oct 2016 09:41:02 -0500 (CDT) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: u9SEf2dl006281 X-TundraWare-MailScanner: Found to be clean X-TundraWare-MailScanner-From: tundra@tundraware.com X-Spam-Status: No X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 14:41:34 -0000 On 10/28/2016 03:34 AM, Arthur Chance wrote: > > > 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@tundraware.com PGP Key: http://www.tundraware.com/PGP/