June 2019
Beginner to intermediate
770 pages
19h 24m
English
To use an executable script file, we have a two-step implementation: make it executable and include a #! (sharp-bang, or shebang) line. We will take a look at the details.
The Linux command to mark a script file as executable looks like the following example:
chmod +x some_script.py
The shebang line will often look like this example:
#!/usr/bin/env python3
This line will direct the OS to use the named program to execute the script file. In this case, we used the /usr/bin/env program to locate the python3 program to run the script. The python3 program will be given the script file as its input.
When a script file is marked executable, and the file includes the #! line, we can use some_script.py at the command ...
Read now
Unlock full access