Bash Scripting
Learn how to automate common tasks using bash scripting.
StartKey Concepts
Review core concepts you need to learn to master this subject
Bash Script Arguments
Bash Script Variables
read
Keyword
Bash Shebang
Bash Aliases
Bash Scripts
Bash script comparison operators
Bash Script Arguments
Bash Script Arguments
#!/bin/bash
# For a script invoked by saycolors red green blue
# echoes red
echo $1
# echoes green
echo $2
# echoes blue
echo $3
Arguments can be added to a bash script after the script’s name. Once provided they can be accessed by using $(position in the argument list)
. For example, the first argument can be accessed with $1
, the second with $2
, the third with $3
, etc.
Learn Bash Scripting
Lesson 1 of 1
- 1Bash (or shell) scripting is a great way to automate repetitive tasks and can save you a ton of time as a developer. Bash scripts execute within a Bash shell interpreter terminal. Any command you c…
- 3When bash scripting, you can use conditionals to control which set of commands within the script run. Use if to start the conditional, followed by the condition in square brackets ([ ]). then begin…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory