#! /usr/bin/env considered harmful - Programming On Unix

Users browsing this thread: 1 Guest(s)
Halfwit
Members
Heh, I like using something like
Code:
#!/bin/sh

py(){
    python - <<<CODE  
        import foo
        print('This will work')
    CODE
}

py

My use of python is generally very limited, though. You can always specify version this way, as you're literally passing a heredoc to the python interpreter; you can call whichever interpreter in your path you require, or /usr/bin/python3.4 if you so desire.

edit - formatting is messed up, heh.


Messages In This Thread
#! /usr/bin/env considered harmful - by jkl - 14-09-2016, 12:27 PM
RE: #! /usr/bin/env considered harmful - by venam - 14-09-2016, 01:04 PM
RE: #! /usr/bin/env considered harmful - by z3bra - 14-09-2016, 01:36 PM
RE: #! /usr/bin/env considered harmful - by jkl - 14-09-2016, 08:13 PM
RE: #! /usr/bin/env considered harmful - by z3bra - 15-09-2016, 05:40 AM
RE: #! /usr/bin/env considered harmful - by z3bra - 15-09-2016, 09:14 AM
RE: #! /usr/bin/env considered harmful - by Halfwit - 14-10-2016, 11:51 PM