←back to thread

185 points thunderbong | 2 comments | | HN request time: 0.574s | source
Show context
fracus ◴[] No.43649037[source]
The shebang seems underbaked to me. There is no way to reference a user's home directory AFIK. I came across this annoyance when trying to make my python virtual environment portable.
replies(2): >>43649230 #>>43649303 #
1. AdieuToLogic ◴[] No.43649230[source]
> The shebang seems underbaked to me. There is no way to reference a user's home directory AFIK. I came across this annoyance when trying to make my python virtual environment portable.

You can use env[0] to invoke a command based on `$PATH` if desired:

  The env utility uses the PATH environment variable to 
  locate the requested utility if the name contains no `/' 
  characters, unless the -P option has been specified.
For shells which have limited shebang functionality[1], specifying the POSIX shell location and then using its builtin `exec` support can suffice.

0 - https://man.freebsd.org/cgi/man.cgi?query=env&apropos=0&sekt...

1 - http://www.acadix.biz/Unix-guide/HTML/ch02s20.html

replies(1): >>43649324 #
2. ◴[] No.43649324[source]