We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Shebang

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.

Assignment

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.