Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh bash compatibility question



Hi Citizens:

I've got a file that I want users to be able to source from either zsh or bash


If, while in zsh, I type

source /whole/path/to/sourcefile

and have   dirname $0 embedded within the sourcefile

In zsh, it will report back the full directory path for the directory in which this file is located, the same way it does for shell scripts.

In bash, I just get the location of the bash executable itself.

Is there an equivalent command that will work in bash (or preferably both shells)?

Thanks.

Bill Scott






Messages sorted by: Reverse Date, Date, Thread, Author