AcademyThe Automator's Grimoire: Scripting WizardryCircle 1: Summoning Basics

Circle 1: Summoning Basics

Stop typing the same commands over and over. A Bash Script is a magical scroll where you write down a sequence of commands, and the machine executes them for you.

Tactical Intel: The Shebang (#!)

Every script needs a starting "Incantation" to tell the OS which language it's written in. For Bash, it is: #!/bin/bash

Directive: Scribe and Awaken

Scripts are just text files, but to make them "alive" (runnable), you must grant them Execute Permissions.

booting...

Tactical Objectives

  1. Scribe the Scroll: Create a file named summon.sh.
    • Add #!/bin/bash on the first line.
    • Add echo "Rise, Automator!" on the second line.
  2. Awaken the Code: Run chmod +x summon.sh to make it executable.
  3. Perform the Summoning: Run ./summon.sh to see your code come to life.

Sorcerer's Insight

In the world of DevOps, we prefix local scripts with ./. This tells the shell to look for the file in the current directory rather than searching through the entire system.

Mission Control

Scribe the Incantation

Expected Command

cat summon.sh

Awaken the Code

Execute the Summoning