EasyEnv
Engineering/Courses/Catalog/Bash/Shebang and Your First Script
Bash
BeginnerLesson 2 of 1225 min · hands-on

Shebang and Your First Script

Part of the Bash course

If the word "script" still sounds like something only real programmers write, relax. A script is just a text file with a list of commands in it, and by the end of this lesson you will have written one, run it, and understood exactly why it worked. Nothing here needs programming experience.

In the last lesson you learned that Bash can be used two ways: typed one line at a time (interactive), or saved in a file and run all at once (a script). A script file is nothing special on disk, it is plain text, the same as a shopping list. What makes it useful is that Bash can read it top to bottom and run every line, so you never retype the same commands twice. ...

Want to learn Bash Shebang and Your First Script in a real environment?

Click below, get a fresh Linux box with Bash ready to go, and work through Shebang and Your First Script hands-on with an AI tutor that knows your code.

Start this lessonShebang and Your First Script

What you'll learn

  • Shebang
  • #!/usr/bin/env bash
  • Chmod +x
  • ./script.sh vs bash script.sh
  • Exit codes

Read this lesson in your language

All lessons in this course

12 lessons
  1. 1What Is Bash20 min
  2. 2Shebang and Your First Script25 min
  3. 3Variables and Quoting25 min
  4. 4Conditionals and Tests30 min
  5. 5Loops25 min
  6. 6Functions25 min
  7. 7Arrays25 min
  8. 8String and Arithmetic Expansion25 min
  9. 9IO Redirection and Pipes25 min
  10. 10Error Handling and Traps30 min
  11. 11Debugging and Best Practices25 min
  12. 12Capstone: Server Bootstrap Script60 min

Explore other courses

Shebang and Your First Script - Bash (English) | Engineering Courses