Shell Scripting for Beginners / Chapter 1 — Running it as a script (lessons 1–3) / Lesson 1
The shebang and the execute bit
Time needed: about 8 min (estimate)
Reading settings
These settings are remembered on this device only.
You can try the opening of this lesson without an account.
The first wall is nearly always in the same place
You gather the commands you have been typing into a file, run ./run.sh, and nothing works.
It says Permission denied.
You copy an article exactly and get bad interpreter.
The first wall in shell scripting is nearly always right here.
This lesson pins down what the #! on line one actually does, by running it.
By the end you can explain for yourself why ./ is required, and whether to write #!/bin/bash or #!/usr/bin/env bash.
hello.sh
Terminal
Create a free account to keep reading
With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.
Report a problem with this lesson
Log in to send a report.