From owner-freebsd-questions@freebsd.org Fri Oct 28 01:55:37 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 EBC3FC234D2 for ; Fri, 28 Oct 2016 01:55:37 +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 A9D5E5E6 for ; Fri, 28 Oct 2016 01:55:37 +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 u9S1rbQU074773 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 27 Oct 2016 20:53:37 -0500 (CDT) (envelope-from tundra@tundraware.com) Subject: Re: Interesting $0 Problem To: Dutch Ingraham , freebsd-questions@freebsd.org References: <20161028014923.GA11638@fedora24> From: Tim Daneliuk Message-ID: Date: Thu, 27 Oct 2016 20:53:32 -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: <20161028014923.GA11638@fedora24> Content-Type: text/plain; charset=windows-1252 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]); Thu, 27 Oct 2016 20:53:37 -0500 (CDT) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: u9S1rbQU074773 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 01:55:38 -0000 On 10/27/2016 08:49 PM, Dutch Ingraham wrote: > 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 ? > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > My .bashrc source as standard startup profile: . mystartup Inside mystartup the folloing statement exists: source foo.sh $0 as reported in foo.sh is coming back with "-/usr/local/bin/bash"... -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/