https://www.codecademy.com/learn/bash-scripting/modules/bash-scripting/cheatsheet
chmod +x script.sh
#!/bin/bash
To ensure that scripts in ~/bin/ are available, you must add this directory to your PATH within your configuration file
PATH=~/bin:$PATH
nano ~/.zshrc
export PATH=~/bin:$PATH
source ~/.zshrc
echo "Hello World!"
greeting="Hello"
echo $greeting
if [ $index -lt 5 ]
then
echo $index
else
echo 5
fi
for word in $paragraph
do
echo $word
done
while [ $index -lt 5 ]
do
echo $index
index=$((index + 1))
done
until [ $index -eq 5 ]
do
echo $index
index=$((index + 1))
done
read number
echo "You guessed $number"
alias saycolors='./saycolors.sh'
alias saycolors='./saycolors.sh "green"'
for filename in source/*
#!/bin/bash
echo "Welcome to our world"
## 1.1.1
firstline=$(head -n 1 source/changelog.md)
read -a splitfirstline <<< $firstline
version=${splitfirstline[1]}
echo "You are building version" $version
echo 'Do you want to continue? (enter "1" for yes, "0" for no)'
read versioncontinue
if [ $versioncontinue -eq 1 ]
then
echo "OK"
else
echo "Please come back when you are ready"
fi
for filename in source/*
do
echo $filename
done
if [ "$filename" == "source/secretinfo.md" ]
then
echo "Not copying" $filename
else
echo "Copying" $filename
cp $filename build/.
fi
cd build/
ls
# We'll add more code here later
cd ..
echo "Build version $version contains:"
ls