From owner-freebsd-questions@freebsd.org Fri Oct 28 01:49:45 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 968FEC23253 for ; Fri, 28 Oct 2016 01:49:45 +0000 (UTC) (envelope-from stoa@gmx.us) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDF91F5E for ; Fri, 28 Oct 2016 01:49:44 +0000 (UTC) (envelope-from stoa@gmx.us) Received: from fedora24 ([97.66.215.44]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M0xbD-1ctg4u0TDr-00v7Nn for ; Fri, 28 Oct 2016 03:49:35 +0200 Date: Thu, 27 Oct 2016 20:49:23 -0500 From: Dutch Ingraham To: freebsd-questions@freebsd.org Subject: Re: Interesting $0 Problem Message-ID: <20161028014923.GA11638@fedora24> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Provags-ID: V03:K0:3Pme6cCmDD5UEDV1yTHM7dCuUVClxzngxky24Jkj7+Mj+5ENg2s J1NWejSIWFwtWwiOELI1Yyx1a9Sf+h7Dlp2F/n0xC9Q3y+CeM1bWabx8Vue0n0iUmUejeld PhhR7Ca7jou8XVgyT5c54GOXw1Sk5iDAs40EGkv/VkKbB8zqFf7s/CL5FNH6ZF+z098mUDo z1j/KSNo72dVzO6mhMvlA== X-UI-Out-Filterresults: notjunk:1;V01:K0:rDexxsIBu4I=:2hAOCPxl3AzGqIeK9HlrWJ i9iH5tY+ElD1jvki5y8Rc/yqFrklh2GDQG1yK+hWFe6LN/QMKjzqsyxKgbp4RJntgKhX+nc0O sTcUvN5CNyaTMhjiRB3UZBprWuiHJa4/7CqNnCAV5wp7JDPdvDDi/gYSmPz/FDBI8NlmVpR2D HOcugoeYh9Hgle50Ey3R7pjCJh05BD7fiSDy619P3fXpJ7JM1+InzDo2xzgzf4kIXpgj+E4Kp GHE3eqed2o04a2KGjYBZysOL/f2yI568SJl1FFBSmgJJY9TLPyTpgrpFh4QO/p4yq8EVnR5Ni H9YY+5BtW7qCGVJfcmvxcWYx+c1vwJ6Dpu7l5oB9dOvp8s25yV1jiLI7gl8H8bFW7zbFpL3r2 aJzQ/tZ8s/EC3vJObYWJc7hHcb+2abT1ts0yV5bMLjpBSrkDvVlTzybKxcEdywv5NNQg/+y47 wxyVXAFxlN5AHlfD+JYQWimnI8avMqSWyuYPhRNjUWe0jHgwen4FoPcLBNOgcJiEK6riLyzOO 4IzVc7ogc5C3xlJXMY87Nxxp0gmyrtrQ9ivlhDyN0IcLEEbJmGo3C2xqbQtPOr+4HCTCbAetH SXJShMvCw1/XOp+EEIiZUe1Irlv/mqJacksf9y9gSmk5bFyYd0JIsCTJNu/9FP7GnAY7PS9XU KyOH+upAj3wq9I0NszKF/KrNRN6VWsJJ4RveBoW/QhaqTzo9kZ/KawkfzZiYc9bBgTZdSm/5A OhJvL/KC0RXr0/g6KQfSOUr59o07WLbXWJ7aDDG6CqweCRD/OTK0A0Jo5eM= 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 01:49:45 -0000 On Thu, Oct 27, 2016 at 08:30:40PM -0500, Tim Daneliuk wrote: > I was fidding with some shell code today and discovered it was breaking > because $0 was returning "-/usr/local/bin/bash". Why is there a leading > dash here? I've not seen that before. How are you invoking the expansion, i.e., from a file or the command-line? Is this a login shell? What do you get from the command-line with ?