←back to thread

185 points thunderbong | 1 comments | | HN request time: 0s | 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 #
fsckboy ◴[] No.43649303[source]
i don't get it.

you need to know where the script is to read the shebang... if it's in the user's home directory, you are already there or you either found it on the path or typed it in... then with bash, tilde's everywhere else you need them?

replies(3): >>43649340 #>>43650470 #>>43656920 #
fracus ◴[] No.43656920[source]
I don't want my user's home directory in the script and therefore, the shebang, for portability reasons. The best solution would to be able to refer to the location of the virtual environment in the shebang relative to the location of the script instead of the current working directory.
replies(1): >>43657734 #
1. fsckboy ◴[] No.43657734{3}[source]
user's home directory is in /etc/passwd and in $HOME in env. the way it's done is, you refer to these