3 ms·
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 virt
by fracus 2y ago
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.
- AdieuToLogic 2y ago> 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&sektion=0&manpath=FreeBSD+14.2-RELEASE+and+Ports&arch=default&format=html https://man.freebsd.org/cgi/man.cgi?query=env&apropos=0&sekt... 1 - http://www.acadix.biz/Unix-guide/HTML/ch02s20.html http://www.acadix.biz/Unix-guide/HTML/ch02s20.html
- deleted 2y ago[deleted]
- fsckboy 2y agoi 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?
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- fracus 2y agoI 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.
- fsckboy 2y agouser's home directory is in /etc/passwd and in $HOME in env. the way it's done is, you refer to these