Interesting $0 Problem

Tim Daneliuk tundra at
Fri Oct 28 01:55:38 UTC 2016

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 <echo "$0">?
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

My .bashrc source as standard startup profile:

  . mystartup

Inside mystartup the folloing statement exists:


$0 as reported in is coming back with "-/usr/local/bin/bash"...

Tim Daneliuk     tundra at
PGP Key:

More information about the freebsd-questions mailing list