* Eric Blake wrote on Tue, Feb 16, 2010 at 02:22:06PM CET: > Next question - how to learn the running script.
This has been discussed by Stefano Lattarini on automake-patches a little while ago, <http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3729/focus=3818> > Good: bash, dash, Solaris /bin/sh, and ksh all appear to preserve $0 into > a sourced script. Meanwhile, zsh botches things when invoked as zsh, but > works when invoked as sh. Since all of our test scripts use #!/bin/sh, if > the script was truly started via the she-bang, we should be fine even if > zsh is /bin/sh. Any counter-examples out there of some other shell that > fails to print "./f1" on the second line using this example? I don't know of any. If you can get zsh into 'emulate sh' mode before the dot command, or invoke it as 'zsh -o no_function_argzero', then things should work with it as well. Cheers, Ralf