All Modules / Module 8 / Lesson 3 of 4

Editing scripts comfortably in a real editor

4 minute read

Make It Runnable

By default, your Mac won't let you run a script as a command. You need to give it permission.

1

Make the script executable:

chmod +x ~/myinfo.sh
2

Run it:

~/myinfo.sh

What's chmod +x? chmod changes file permissions. +x adds "execute" permission, letting you run it as a command.

Key Takeaway

chmod +x script.sh makes a script executable. Then run it with ./script.sh or the full path.