#!/bin/bash # mkstuff # create .funcs and .bash_aliases # echo "Did you create you $HOME/bin dir? " read X cat - > ~/.bash_aliases << "EOF" #.bash_aliases export PATH="$HOME/bin:$HOME/inclass:$PATH" alias h=' history' alias l=' ls -sailF --color=auto' alias la=' ls -A --color=auto' alias lc=' ls -CF --color=auto' alias ll=' ls -alF --color=auto' alias lr=' ls -rtlF --color=auto' EOF cat - > ~/.funcs << "FUN" whdr() { echo 'bash web
'

}
wftr() {
echo '
' } calcit() { printf "%s\n" "$@" | bc -lq ~/.bcrc } FUN cat - > ~/.bcrc << BCRC scale=2 BCRC cat -> ~/bin/upit << UPIT #!/bin/bash # upit #snap refresh sudo apt-get check sudo apt-get clean sudo apt-get -y autoclean sudo apt-get remove sudo apt-get -y autoremove sudo apt-get update sudo apt-get -y upgrade sudo apt-get -y dist-upgrade uname -a cat /proc/version cat /etc/os-release #-- UPIT chmod +x ~/bin/upit cat - >> ~/.bashrc << SETF if [ -f ~/.funcs ]; then . ~/.funcs fi #-- SETF cat - >> ~/bin/for_loop << "SETLOOP" #!/bin/bash # for_loop # bash for_loop to run script #Give a sequence from 1 to 10 LST=$(seq 1 10) for x in $LST do echo $x sleep 1 done SETLOOP cat - >> ~/bin/stoplight << "SETIF" #!/bin/bash # stoplight # simple if test display_light () { case $1 in "red") echo "red light stop." ;; "yellow") echo "If cop slow, if not speed up" ;; "green") echo "green light go" ;; *) echo "can't";; esac } #main while true do echo -n "Enter a stoplight color all lower case -> " read light # [ is equal to cmd test if [ $light == "q" ] then break fi display_light $light done SETIF # Enable both Stoplight and For_loop scripts chmod +x ~/bin/stoplight ~/bin/for_loop # enable the getty for ttyS0 (getty allows login) sudo systemctl enable serial-getty@ttyS0.service sudo systemctl start serial-getty@ttyS0.service sudo systemctl daemon-reload # install web server sudo tasksel install web-server # multiline comments - unorthodox :<<'CMT' here docs are awesome! Linux runs the world. Amazing for overwieght penguin. #--