A place to breathe

Monday, February 20, 2017

The all powerful Shebang

When you write scripts, often times, you'll see the following line at the top:

#!/usr/bin/python 

Now what is this?

This line allows you to run your script as the executable, without invoking the interpreter. For example, if I write a python script called blabla.py, I will need to run it this way:

%> python blabla.py 

change the permission and add the shebang line, will allow you to run it this way:

%> chmod +x blabla.py
%> ./blabla.py 

if you want to run it in the background, then call the no hangup:
%> nohup ./blabla.py 

It will run itself doing its thing. Time to go to sleep while waiting for it to finish.

No comments:

About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.