Bash Scripting Basics, Control Structures, Loops
Basics
hello-world.sh
#!/bin/bash
# This is a comment
echo "Hello world"bash hello-world.sh
Hello world
# bash is the executable program
# To start the script without "bash" command, the script must be executable
chmod +x hello-world.sh
./hello-world.sh
Hello worldexecuting-commands-example.sh
Control Structures
if-examples.sh
comparison-examples.sh
case-example.sh
Loops
Definite loops
Indefinite loops
Infinite loops
loop-examples.sh
Examples
command-line-arguments-example.sh
generate-password.sh

Last updated