

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Compiled vs. Interpreted
incomplete
2: Executables
incomplete
3: Shebang
incomplete
4: Bourne Shell
incomplete
5: Environment Variables
incomplete
6: PATH
incomplete
7: Change Your PATH
incomplete
This lesson's interactive features are locked, please to keep using them
As we talked about before, you can run any executable file by typing its file path into your shell. For example:
bin/genids.sh
That works out-of-the-box for files that are compiled executables. But what about scripts that need to be interpreted by another program? The computer needs to be told what program to use to interpret the file.
A "shebang" is a special line at the top of a script that tells your shell which program to use to execute the file.
The format of a shebang is:
#! interpreter [optional-arg]
For example, if your script is a Python script and you want to use Python 3, your shebang might look like this:
#!/usr/bin/python3
This tells the system to use the Python 3 interpreter located at /usr/bin/python3 to run the script.
Use the cat command to view the contents of the worldbanc/private/bin/genids.sh file. Notice the shebang at the top of the file!
Submit the shell checks.