Shell Scripting
#!/bin/bash
name="World"
echo "Hello, $name!"
for f in *.txt; do
echo "Processing $f"
done
if [ -f "config.txt" ]; then
echo "Config exists"
fi
Summary
- Shell scripts automate Linux tasks
- Use #!/bin/bash as the first line
#!/bin/bash
name="World"
echo "Hello, $name!"
for f in *.txt; do
echo "Processing $f"
done
if [ -f "config.txt" ]; then
echo "Config exists"
fi
YouTip