Coding for All
Your First Script

Your First Script

Intermediate About Bash →

Save your commands in a file and let the computer run them: variables, arguments, ifs, loops and functions. 8 lessons that build on Intro to Bash.

0 / 8 lessons complete
Start Lesson 1
1
Your First Script
Put two lines in a file and make the computer run them.
2
Comments and Variables
Explain your script to humans, and store a value in it.
3
Asking a Question
Let the script ask the person running it for an answer.
4
Arguments
Pass information to a script as you run it.
5
Making Decisions
Do one thing or another, depending on a test.
6
Looping Over a List
Repeat the same work once for every item.
7
Functions
Give a piece of your script a name and reuse it.
8
A Script That Does Real Work
Combine loops, variables and commands into a proper little tool.