I'm looking for what to put on my_zsh_script.sh
's "shebang line" that would have the same effect, portably, as
$SHELL my_zsh_script.sh
IOW, I looking for the valid equivalent of
#!$SHELL
or
#!/usr/bin/env $SHELL
(In some systems, my value for $SHELL
is a version of zsh
that, under some circumstances, differs from what #!/usr/bin/env zsh
resolves to.)
I suppose that I can always arrange to have my_zsh_script.sh
custom-built, with the right shebang line hard-coded in, for each host I may want to run it on. I'm hoping to avoid this scenario.
exec $SHELL "$@"
or similar in it, then use that for the shbang.zsh
, no? It's not portable if run by someone for whom$SHELL
is, say,/bin/bash
.$SHELL
is the most reliable way to get at the correct path tozsh
over all these accounts.