In Unix, Linux or Linux-like systems, scripts can be given execution rights (chmod +x script_filemane
) and run as ordinary applications. These scripts are called executable scripts.
The first line of an executable script is special. It starts with #!, called hashbang or shebang, telling the system where to find the program to run the scripts. For example:
#!/usr/local/opt/python/libexec/bin/python
print('The bright side' + ' of life...')
We can use the Linux env
lookup hack to make the scripts more portable (assuming the env
utility is always located at /usr/bin/env)
.
#!/usr/bin/env python
print("The bright side of life...")