Learn to automate tasks with bash shell scripts. Master variables, conditionals (if/else), loops (for/while), functions, and command-line arguments to create powerful automation scripts.
Write a simple bash script with shebang and basic commands.
cd ~mkdir scripting-practice && cd scripting-practicecat > hello.sh << 'EOF'
#!/bin/bash
echo "Hello, World!"
echo "Today is $(date +%A)"
EOFcat hello.shchmod +x hello.sh./hello.sh#!/bin/bash is shebang (tells system to use bash). echo prints messages. $(command) runs command and uses output. chmod +x makes script executable. ./ runs script in current directory.
Script created with shebang and two echo lines. chmod makes it executable. ./hello.sh prints greeting and current day name.