NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/45430: ash uses argv[0] as $0 for scripts without #!



On 11/06/2011 02:50 AM, David Holland wrote:
  better way to do that:

  XYZZY=--; exec lua $(type "$0" | cut -d' ' -f3) "$@"

  Here at least lua accepts "XYZZY=" with no value, but you can also do

  XYZZY="zzyzx"--; exec lua $(type "$0" | cut -d' ' -f3) "$@"

Still slightly better way to do this, combined with the "command" solution:

_=_--; exec lua "`command -v \"\$0\"`" "\$@"

I think I'm going to stop on this one and maybe revert the sh fix I did in
our branch to keep merges simpler.

Thanks for all the help, no matter the disagreement :)

Sincerely,
Nick


Home | Main Index | Thread Index | Old Index