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

Making a Script Executable

You'll frequently write your own scripts, or download them from the internet, only to find that they refuse to run:

$ ./conquerworld.sh
bash: ./conquerworld.sh: Permission denied

This happens all the time, and it trips people up constantly. The code is fine and the file is right there, but it's missing the execute permission. The fix is a one-liner: add the execute bit with chmod +x. I use chmod +x all the time as a developer.

Interactive example available with JavaScript enabled.

chmod +x conquerworld.sh
./conquerworld.sh
# it works!

The internet is a shady place. Only make executable (and run) scripts from publishers and authors you trust.

Assignment

We just added execute permission to the genids.sh script in worldbanc/private/bin.

Paste the output of the script into the input field and submit your answer.