Skip to content


Subversion checkout URL

You can clone with
Download ZIP


$0 does not work when .profile is sourced #3

mikehale opened this Issue · 0 comments

2 participants


When attempting to use the .profile generated by an anvil build $0 breaks. I put together a simple example:

The script:

$ cat 

set -x

echo "$(dirname $0)"

Running the script works:

$ ./
++ dirname ./
+ echo .

Sourcing it does not (I think this is similar to how .profile will be called from /etc/profile):

$ source
+++ dirname -su
dirname: invalid option -- 's'
Try `dirname --help' for more information.
++ echo ''

I think perhaps this is related:

Can we assume that .profile will always be in $HOME?

@ddollar ddollar closed this in 2b9bd63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.