├── 01-what-is-bash ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash └── 13.bash ├── 02-bash-command-structure ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash └── 20.bash ├── 03-essential-commands ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash ├── 40.bash ├── 41.bash ├── 42.bash ├── 43.bash ├── 44.bash ├── 45.bash ├── 46.bash ├── 47.bash ├── 48.bash ├── 49.bash ├── 50.bash ├── 51.bash ├── 52.bash ├── 53.bash ├── 54.bash ├── 55.bash ├── 56.bash ├── 57.bash ├── 58.bash ├── 59.bash ├── 60.bash ├── 61.bash ├── 62.bash ├── 63.bash ├── 64.bash ├── 65.bash ├── 66.bash ├── 67.bash ├── 68.bash ├── 69.bash ├── 70.bash ├── 71.bash ├── 72.bash ├── 73.bash ├── 74.bash ├── 75.bash ├── 76.bash ├── 77.bash ├── 78.bash ├── 79.bash ├── 80.bash ├── 81.bash ├── 82.bash ├── 83.bash ├── 84.bash ├── 85.bash ├── 86.bash ├── 87.bash ├── 88.bash ├── 89.bash ├── 90.bash ├── 91.bash ├── 92.bash └── 93.bash ├── 04-input-output-and-redirection ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash ├── 40.bash ├── 41.bash ├── 42.bash ├── 43.bash ├── 44.bash ├── 45.bash ├── 46.bash ├── 47.bash ├── 48.bash ├── 49.bash ├── 50.bash ├── 51.bash ├── 52.bash ├── 53.bash ├── 54.bash ├── 55.bash ├── 56.bash ├── 57.bash ├── 58.bash ├── 59.bash ├── 60.bash ├── 61.bash └── 62.bash ├── 05-variables-and-patterns ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash ├── 40.bash ├── 41.bash ├── 42.bash ├── 43.bash ├── 44.bash ├── 45.bash ├── 46.bash ├── 47.bash ├── 48.bash ├── 49.bash ├── 50.bash ├── 51.bash ├── 52.bash ├── 53.bash ├── 54.bash ├── 55.bash ├── 56.bash ├── 57.bash ├── 58.bash ├── 59.bash ├── 60.bash ├── 61.bash ├── 62.bash ├── 63.bash ├── 64.bash ├── 65.bash ├── 66.bash ├── 67.bash ├── 68.bash ├── 69.bash ├── 70.bash ├── 71.bash ├── 72.bash ├── 73.bash └── 74.bash ├── 06-loops-and-conditionals ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash ├── 40.bash ├── 41.bash ├── 42.bash ├── 43.bash ├── 44.bash ├── 45.bash ├── 46.bash ├── 47.bash ├── 48.bash ├── 49.bash ├── 50.bash ├── 51.bash ├── 52.bash ├── 53.bash ├── 54.bash ├── 55.bash ├── 56.bash ├── 57.bash └── 58.bash ├── 07-scripts-functions-and-aliases ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash ├── 40.bash ├── 41.bash ├── 42.bash ├── 43.bash ├── 44.bash ├── 45.bash ├── 46.bash ├── 47.bash ├── 48.bash ├── 49.bash ├── 50.bash ├── 51.bash ├── 52.bash ├── 53.bash ├── 54.bash ├── 55.bash ├── 56.bash ├── 57.bash ├── 58.bash └── 59.bash ├── 08-best-practices ├── 01.bash ├── 02.bash ├── 03.bash ├── 04.bash ├── 05.bash ├── 06.bash ├── 07.bash ├── 08.bash ├── 09.bash ├── 10.bash ├── 11.bash ├── 12.bash ├── 13.bash ├── 14.bash ├── 15.bash ├── 16.bash ├── 17.bash ├── 18.bash ├── 19.bash ├── 20.bash ├── 21.bash ├── 22.bash ├── 23.bash ├── 24.bash ├── 25.bash ├── 26.bash ├── 27.bash ├── 28.bash ├── 29.bash ├── 30.bash ├── 31.bash ├── 32.bash ├── 33.bash ├── 34.bash ├── 35.bash ├── 36.bash ├── 37.bash ├── 38.bash ├── 39.bash └── 40.bash ├── LICENSE └── README.md /01-what-is-bash/01.bash: -------------------------------------------------------------------------------- 1 | bash$ declare -p BASH 2 | -------------------------------------------------------------------------------- /01-what-is-bash/02.bash: -------------------------------------------------------------------------------- 1 | declare -- BASH="/bin/bash" 2 | -------------------------------------------------------------------------------- /01-what-is-bash/03.bash: -------------------------------------------------------------------------------- 1 | $ echo "$SHELL" 2 | -------------------------------------------------------------------------------- /01-what-is-bash/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/01-what-is-bash/04.bash -------------------------------------------------------------------------------- /01-what-is-bash/05.bash: -------------------------------------------------------------------------------- 1 | $ chsh -s /usr/local/bin/bash 2 | -------------------------------------------------------------------------------- /01-what-is-bash/06.bash: -------------------------------------------------------------------------------- 1 | $ cat /etc/shells 2 | -------------------------------------------------------------------------------- /01-what-is-bash/07.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/01-what-is-bash/07.bash -------------------------------------------------------------------------------- /01-what-is-bash/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/01-what-is-bash/08.bash -------------------------------------------------------------------------------- /01-what-is-bash/09.bash: -------------------------------------------------------------------------------- 1 | $ brew install bash 2 | -------------------------------------------------------------------------------- /01-what-is-bash/10.bash: -------------------------------------------------------------------------------- 1 | bash$ help printf 2 | -------------------------------------------------------------------------------- /01-what-is-bash/11.bash: -------------------------------------------------------------------------------- 1 | bash$ man printf 2 | -------------------------------------------------------------------------------- /01-what-is-bash/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/01-what-is-bash/12.bash -------------------------------------------------------------------------------- /01-what-is-bash/13.bash: -------------------------------------------------------------------------------- 1 | bash$ help 2 | -------------------------------------------------------------------------------- /02-bash-command-structure/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/01.bash -------------------------------------------------------------------------------- /02-bash-command-structure/02.bash: -------------------------------------------------------------------------------- 1 | $ mkdir -p New/bash 2 | -------------------------------------------------------------------------------- /02-bash-command-structure/03.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/03.bash -------------------------------------------------------------------------------- /02-bash-command-structure/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/04.bash -------------------------------------------------------------------------------- /02-bash-command-structure/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/05.bash -------------------------------------------------------------------------------- /02-bash-command-structure/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/06.bash -------------------------------------------------------------------------------- /02-bash-command-structure/07.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/07.bash -------------------------------------------------------------------------------- /02-bash-command-structure/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/08.bash -------------------------------------------------------------------------------- /02-bash-command-structure/09.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/09.bash -------------------------------------------------------------------------------- /02-bash-command-structure/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/10.bash -------------------------------------------------------------------------------- /02-bash-command-structure/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/11.bash -------------------------------------------------------------------------------- /02-bash-command-structure/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/12.bash -------------------------------------------------------------------------------- /02-bash-command-structure/13.bash: -------------------------------------------------------------------------------- 1 | $ cd ; ls -a ; mkdir New 2 | -------------------------------------------------------------------------------- /02-bash-command-structure/14.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/14.bash -------------------------------------------------------------------------------- /02-bash-command-structure/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/15.bash -------------------------------------------------------------------------------- /02-bash-command-structure/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/16.bash -------------------------------------------------------------------------------- /02-bash-command-structure/17.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/17.bash -------------------------------------------------------------------------------- /02-bash-command-structure/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/18.bash -------------------------------------------------------------------------------- /02-bash-command-structure/19.bash: -------------------------------------------------------------------------------- 1 | $ cd && rmdir ~/nonexistent && ls 2 | -------------------------------------------------------------------------------- /02-bash-command-structure/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/02-bash-command-structure/20.bash -------------------------------------------------------------------------------- /03-essential-commands/01.bash: -------------------------------------------------------------------------------- 1 | bash$ help type 2 | -------------------------------------------------------------------------------- /03-essential-commands/02.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/02.bash -------------------------------------------------------------------------------- /03-essential-commands/03.bash: -------------------------------------------------------------------------------- 1 | bash$ type for 2 | for is a shell keyword 3 | -------------------------------------------------------------------------------- /03-essential-commands/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/04.bash -------------------------------------------------------------------------------- /03-essential-commands/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/05.bash -------------------------------------------------------------------------------- /03-essential-commands/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/06.bash -------------------------------------------------------------------------------- /03-essential-commands/07.bash: -------------------------------------------------------------------------------- 1 | $ /bin/true 2 | -------------------------------------------------------------------------------- /03-essential-commands/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/08.bash -------------------------------------------------------------------------------- /03-essential-commands/09.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/09.bash -------------------------------------------------------------------------------- /03-essential-commands/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/10.bash -------------------------------------------------------------------------------- /03-essential-commands/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/11.bash -------------------------------------------------------------------------------- /03-essential-commands/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/12.bash -------------------------------------------------------------------------------- /03-essential-commands/13.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/13.bash -------------------------------------------------------------------------------- /03-essential-commands/14.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/14.bash -------------------------------------------------------------------------------- /03-essential-commands/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/15.bash -------------------------------------------------------------------------------- /03-essential-commands/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/16.bash -------------------------------------------------------------------------------- /03-essential-commands/17.bash: -------------------------------------------------------------------------------- 1 | $ pwd 2 | /home/bashuser 3 | -------------------------------------------------------------------------------- /03-essential-commands/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/18.bash -------------------------------------------------------------------------------- /03-essential-commands/19.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/19.bash -------------------------------------------------------------------------------- /03-essential-commands/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/20.bash -------------------------------------------------------------------------------- /03-essential-commands/21.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/21.bash -------------------------------------------------------------------------------- /03-essential-commands/22.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/22.bash -------------------------------------------------------------------------------- /03-essential-commands/23.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/23.bash -------------------------------------------------------------------------------- /03-essential-commands/24.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/24.bash -------------------------------------------------------------------------------- /03-essential-commands/25.bash: -------------------------------------------------------------------------------- 1 | $ cd 2 | $ pwd 3 | /home/bashuser 4 | -------------------------------------------------------------------------------- /03-essential-commands/26.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/26.bash -------------------------------------------------------------------------------- /03-essential-commands/27.bash: -------------------------------------------------------------------------------- 1 | cd /tmp 2 | ls 3 | -------------------------------------------------------------------------------- /03-essential-commands/28.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/28.bash -------------------------------------------------------------------------------- /03-essential-commands/29.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/29.bash -------------------------------------------------------------------------------- /03-essential-commands/30.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/30.bash -------------------------------------------------------------------------------- /03-essential-commands/31.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/31.bash -------------------------------------------------------------------------------- /03-essential-commands/32.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/32.bash -------------------------------------------------------------------------------- /03-essential-commands/33.bash: -------------------------------------------------------------------------------- 1 | $ [ -e /etc/passwd ] && echo 'Password file exists!' 2 | -------------------------------------------------------------------------------- /03-essential-commands/34.bash: -------------------------------------------------------------------------------- 1 | bash$ type [[ 2 | [[ is a shell keyword 3 | -------------------------------------------------------------------------------- /03-essential-commands/35.bash: -------------------------------------------------------------------------------- 1 | $ ls 2 | books documents music 3 | -------------------------------------------------------------------------------- /03-essential-commands/36.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/36.bash -------------------------------------------------------------------------------- /03-essential-commands/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/37.bash -------------------------------------------------------------------------------- /03-essential-commands/38.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/38.bash -------------------------------------------------------------------------------- /03-essential-commands/39.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/39.bash -------------------------------------------------------------------------------- /03-essential-commands/40.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/40.bash -------------------------------------------------------------------------------- /03-essential-commands/41.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/41.bash -------------------------------------------------------------------------------- /03-essential-commands/42.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/42.bash -------------------------------------------------------------------------------- /03-essential-commands/43.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/43.bash -------------------------------------------------------------------------------- /03-essential-commands/44.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/44.bash -------------------------------------------------------------------------------- /03-essential-commands/45.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/45.bash -------------------------------------------------------------------------------- /03-essential-commands/46.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/46.bash -------------------------------------------------------------------------------- /03-essential-commands/47.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/47.bash -------------------------------------------------------------------------------- /03-essential-commands/48.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/48.bash -------------------------------------------------------------------------------- /03-essential-commands/49.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/49.bash -------------------------------------------------------------------------------- /03-essential-commands/50.bash: -------------------------------------------------------------------------------- 1 | $ cp -R olddir newdir 2 | -------------------------------------------------------------------------------- /03-essential-commands/51.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/51.bash -------------------------------------------------------------------------------- /03-essential-commands/52.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/52.bash -------------------------------------------------------------------------------- /03-essential-commands/53.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/53.bash -------------------------------------------------------------------------------- /03-essential-commands/54.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/54.bash -------------------------------------------------------------------------------- /03-essential-commands/55.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/55.bash -------------------------------------------------------------------------------- /03-essential-commands/56.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/56.bash -------------------------------------------------------------------------------- /03-essential-commands/57.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/57.bash -------------------------------------------------------------------------------- /03-essential-commands/58.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/58.bash -------------------------------------------------------------------------------- /03-essential-commands/59.bash: -------------------------------------------------------------------------------- 1 | $ grep -c telnet /etc/services 2 | 5 3 | -------------------------------------------------------------------------------- /03-essential-commands/60.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/60.bash -------------------------------------------------------------------------------- /03-essential-commands/61.bash: -------------------------------------------------------------------------------- 1 | $ grep -F '$' monthly-costs 2 | -------------------------------------------------------------------------------- /03-essential-commands/62.bash: -------------------------------------------------------------------------------- 1 | $ grep -v '^#' /etc/services 2 | -------------------------------------------------------------------------------- /03-essential-commands/63.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/63.bash -------------------------------------------------------------------------------- /03-essential-commands/64.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/64.bash -------------------------------------------------------------------------------- /03-essential-commands/65.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/65.bash -------------------------------------------------------------------------------- /03-essential-commands/66.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/66.bash -------------------------------------------------------------------------------- /03-essential-commands/67.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/67.bash -------------------------------------------------------------------------------- /03-essential-commands/68.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/68.bash -------------------------------------------------------------------------------- /03-essential-commands/69.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/69.bash -------------------------------------------------------------------------------- /03-essential-commands/70.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/70.bash -------------------------------------------------------------------------------- /03-essential-commands/71.bash: -------------------------------------------------------------------------------- 1 | $ wc -c /bin/bash 2 | 1099016 3 | -------------------------------------------------------------------------------- /03-essential-commands/72.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/72.bash -------------------------------------------------------------------------------- /03-essential-commands/73.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/73.bash -------------------------------------------------------------------------------- /03-essential-commands/74.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes -print 2 | -------------------------------------------------------------------------------- /03-essential-commands/75.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes | sort 2 | -------------------------------------------------------------------------------- /03-essential-commands/76.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes ~/manuals todo.txt 2 | -------------------------------------------------------------------------------- /03-essential-commands/77.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes -name '*fish*' -print 2 | -------------------------------------------------------------------------------- /03-essential-commands/78.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes -name '*fish*' -type f -print 2 | -------------------------------------------------------------------------------- /03-essential-commands/79.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes -mtime +3 -print 2 | -------------------------------------------------------------------------------- /03-essential-commands/80.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes -mtime -5 -print 2 | -------------------------------------------------------------------------------- /03-essential-commands/81.bash: -------------------------------------------------------------------------------- 1 | $ find ~/recipes ! -name '*chicken*' 2 | -------------------------------------------------------------------------------- /03-essential-commands/82.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/82.bash -------------------------------------------------------------------------------- /03-essential-commands/83.bash: -------------------------------------------------------------------------------- 1 | $ find vim -type f -name '*.vim' -exec grep -F search -- {} \; 2 | -------------------------------------------------------------------------------- /03-essential-commands/84.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/84.bash -------------------------------------------------------------------------------- /03-essential-commands/85.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/85.bash -------------------------------------------------------------------------------- /03-essential-commands/86.bash: -------------------------------------------------------------------------------- 1 | $ find vim -type f -name '*.vim' -exec grep -F search -- {} + 2 | -------------------------------------------------------------------------------- /03-essential-commands/87.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/87.bash -------------------------------------------------------------------------------- /03-essential-commands/88.bash: -------------------------------------------------------------------------------- 1 | $ find vim -type f -name '*.vim' | xargs grep -F search -- 2 | -------------------------------------------------------------------------------- /03-essential-commands/89.bash: -------------------------------------------------------------------------------- 1 | $ find vim -type f -name '*.vim' -print0 | xargs -0 grep -F search -- 2 | -------------------------------------------------------------------------------- /03-essential-commands/90.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/90.bash -------------------------------------------------------------------------------- /03-essential-commands/91.bash: -------------------------------------------------------------------------------- 1 | $ sort -t: -k6,6 /etc/passwd 2 | -------------------------------------------------------------------------------- /03-essential-commands/92.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/92.bash -------------------------------------------------------------------------------- /03-essential-commands/93.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/03-essential-commands/93.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/01.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/02.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/02.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/03.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/03.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/04.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/05.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/06.bash: -------------------------------------------------------------------------------- 1 | $ printf 'Hello, file!\n' > "$HOME"/myfile 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/07.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/07.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/08.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/09.bash: -------------------------------------------------------------------------------- 1 | $ set -C 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/10.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/11.bash: -------------------------------------------------------------------------------- 1 | $ set -C 2 | $ printf 'Third command\n' >| myfile 3 | $ 4 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/12.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/13.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/13.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/14.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/14.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/15.bash: -------------------------------------------------------------------------------- 1 | $ stat -c %a myfile 2 | 644 3 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/16.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/17.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/17.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/18.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/19.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/19.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/20.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/21.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/21.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/22.bash: -------------------------------------------------------------------------------- 1 | $ grep pattern myfile /nonexistent > matches 2>&1 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/23.bash: -------------------------------------------------------------------------------- 1 | $ grep pattern myfile /nonexistent > matches 2> /dev/null 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/24.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/24.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/25.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/25.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/26.bash: -------------------------------------------------------------------------------- 1 | $ grep pattern myfile /nonexistent > matches 2>> errorlog 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/27.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/27.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/28.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/28.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/29.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/29.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/30.bash: -------------------------------------------------------------------------------- 1 | $ tr a-z A-Z 2 | Hello, world! 3 | HELLO, WORLD! 4 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/31.bash: -------------------------------------------------------------------------------- 1 | $ tr a-z A-Z mylines 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/32.bash: -------------------------------------------------------------------------------- 1 | $ cat mylines | tr a-z A-Z 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/33.bash: -------------------------------------------------------------------------------- 1 | $ tr a-z A-Z < mylines 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/34.bash: -------------------------------------------------------------------------------- 1 | $ < mylines tr a-z A-Z 2 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/35.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/35.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/36.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/36.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/37.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/38.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/38.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/39.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/39.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/40.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/40.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/41.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/41.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/42.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/42.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/43.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/43.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/44.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/44.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/45.bash: -------------------------------------------------------------------------------- 1 | 3 bash 2 | 3 script 3 | 1 user 4 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/46.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/46.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/47.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/47.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/48.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/48.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/49.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/49.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/50.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/50.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/51.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/51.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/52.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/52.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/53.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/53.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/54.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/54.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/55.bash: -------------------------------------------------------------------------------- 1 | $ sed '1,2d' manual 2 | and write the results to standard output. 3 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/56.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/56.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/57.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/57.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/58.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/58.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/59.bash: -------------------------------------------------------------------------------- 1 | $ awk '{ print $2 }' groceries 2 | Quantity 3 | 5 4 | 1 5 | 2 6 | -------------------------------------------------------------------------------- /04-input-output-and-redirection/60.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/60.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/61.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/61.bash -------------------------------------------------------------------------------- /04-input-output-and-redirection/62.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/04-input-output-and-redirection/62.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/01.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/02.bash: -------------------------------------------------------------------------------- 1 | myshell='sh' 2 | myvar='GNU'\''s Not Unix!' 3 | myprompt="$USER@$HOST" 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/03.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/03.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/04.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/05.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/06.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/07.bash: -------------------------------------------------------------------------------- 1 | $ system= 2 | -------------------------------------------------------------------------------- /05-variables-and-patterns/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/08.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/09.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/09.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/10.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/11.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/12.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/13.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/13.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/14.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/14.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/15.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/16.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/17.bash: -------------------------------------------------------------------------------- 1 | $ LC_COLLATE=C 2 | $ sort words 3 | Alfred 4 | alligator 5 | -------------------------------------------------------------------------------- /05-variables-and-patterns/18.bash: -------------------------------------------------------------------------------- 1 | $ LC_COLLATE=C sort words 2 | Alfred 3 | alligator 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/19.bash: -------------------------------------------------------------------------------- 1 | lc_collate=C 2 | LC_COLLATE=C sort words 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/20.bash: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PATH=/home/bashuser/myfile 3 | grep -- mystring "$PATH" 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/21.bash: -------------------------------------------------------------------------------- 1 | grep: command not found 2 | -------------------------------------------------------------------------------- /05-variables-and-patterns/22.bash: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | path=/home/bashuser/myfille 3 | grep -- mystring "$path" 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/23.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/23.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/24.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/24.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/25.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/25.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/26.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/26.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/27.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/27.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/28.bash: -------------------------------------------------------------------------------- 1 | $ read -r myname 2 | Bash User 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/29.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/29.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/30.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/30.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/31.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/31.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/32.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd -- "${MYSCRIPT_DIR:-/usr/local/myscript}" 3 | ... 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/33.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd -- "${MYSCRIPT_DIR:=/usr/local/myscript}" 3 | ... 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/34.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/34.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/35.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/35.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/36.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/36.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/37.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/38.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/38.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/39.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/39.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/40.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/40.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/41.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/41.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/42.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/42.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/43.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/43.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/44.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/44.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/45.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/45.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/46.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/46.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/47.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/47.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/48.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/48.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/49.bash: -------------------------------------------------------------------------------- 1 | $ printf '%.2f\n' "$((3/2))" 2 | 1.00 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/50.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/50.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/51.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/51.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/52.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/52.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/53.bash: -------------------------------------------------------------------------------- 1 | $ printf '%s\n' a* 2 | april 3 | august 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/54.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/54.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/55.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/55.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/56.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/56.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/57.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/57.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/58.bash: -------------------------------------------------------------------------------- 1 | $ printf '%s\n' *[!lr] 2 | august 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/59.bash: -------------------------------------------------------------------------------- 1 | [a-z] 2 | [0-9] 3 | [[:alnum:]] 4 | -------------------------------------------------------------------------------- /05-variables-and-patterns/60.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/60.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/61.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/61.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/62.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/62.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/63.bash: -------------------------------------------------------------------------------- 1 | $ printf '%s\n' c* 2 | c* 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/64.bash: -------------------------------------------------------------------------------- 1 | $ cat -- c* 2 | cat: 'c*': No such file or directory 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/65.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/65.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/66.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/66.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/67.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/67.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/68.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/68.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/69.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/69.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/70.bash: -------------------------------------------------------------------------------- 1 | bash$ printf '%s\n' "${fruits[-1]}" 2 | cherry 3 | -------------------------------------------------------------------------------- /05-variables-and-patterns/71.bash: -------------------------------------------------------------------------------- 1 | bash$ printf '%s\n' "${fruits[@]}" 2 | apple 3 | banana 4 | cherry 5 | -------------------------------------------------------------------------------- /05-variables-and-patterns/72.bash: -------------------------------------------------------------------------------- 1 | bash$ printf '%s\n' "${fruits[@]^^}" 2 | APPLE 3 | BANANA 4 | CARROT 5 | -------------------------------------------------------------------------------- /05-variables-and-patterns/73.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/73.bash -------------------------------------------------------------------------------- /05-variables-and-patterns/74.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/05-variables-and-patterns/74.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/01.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/02.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/02.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/03.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/03.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/04.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/05.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/06.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/07.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/07.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/08.bash: -------------------------------------------------------------------------------- 1 | $ [ "$myshell" = 'bash' ] && printf 'Match!\n' 2 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/09.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/09.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/10.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/11.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/12.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/13.bash: -------------------------------------------------------------------------------- 1 | [[ $myshell = b* ]] 2 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/14.bash: -------------------------------------------------------------------------------- 1 | [[ $myshell =~ 'sh$' ]] 2 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/15.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/16.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/17.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/17.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/18.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/19.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/19.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/20.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/21.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/21.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/22.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/22.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/23.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/23.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/24.bash: -------------------------------------------------------------------------------- 1 | for system in "$@" ; do 2 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/25.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/25.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/26.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/26.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/27.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/27.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/28.bash: -------------------------------------------------------------------------------- 1 | Warning: file /tmp/myapp/* still exists 2 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/29.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/29.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/30.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/30.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/31.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/31.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/32.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/32.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/33.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/33.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/34.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/34.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/35.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/35.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/36.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/36.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/37.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/38.bash: -------------------------------------------------------------------------------- 1 | Ken Thompson 2 | Dennis Ritchie 3 | John McCarthy 4 | Larry Wall 5 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/39.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/39.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/40.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/40.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/41.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/41.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/42.bash: -------------------------------------------------------------------------------- 1 | Thompson 2 | Ritchie 3 | McCarthy 4 | Wall 5 | -------------------------------------------------------------------------------- /06-loops-and-conditionals/43.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/43.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/44.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/44.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/45.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/45.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/46.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/46.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/47.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/47.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/48.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/48.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/49.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/49.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/50.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/50.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/51.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/51.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/52.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/52.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/53.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/53.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/54.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/54.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/55.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/55.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/56.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/56.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/57.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/57.bash -------------------------------------------------------------------------------- /06-loops-and-conditionals/58.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/06-loops-and-conditionals/58.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/01.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/02.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/02.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/03.bash: -------------------------------------------------------------------------------- 1 | bash$ alias ll='ls -l' 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/04.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/05.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/06.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/07.bash: -------------------------------------------------------------------------------- 1 | bash$ alias mkcd='mkdir -p;cd' 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/08.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/08.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/09.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/09.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/10.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/10.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/11.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/12.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/13.bash: -------------------------------------------------------------------------------- 1 | bash$ home() { printf '%s\n' "$HOME" ; } 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/14.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/14.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/15.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/16.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/17.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/17.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/18.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/19.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/19.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/20.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/21.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/21.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/22.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/22.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/23.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/23.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/24.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/24.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/25.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/25.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/26.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/26.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/27.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/27.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/28.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/28.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/29.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/29.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/30.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/30.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/31.bash: -------------------------------------------------------------------------------- 1 | bash$ home | wc -c 2 | 15 3 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/32.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/32.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/33.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/33.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/34.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/34.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/35.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/35.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/36.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/36.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/37.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/38.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/38.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/39.bash: -------------------------------------------------------------------------------- 1 | bash$ declare -f home >> ~/.bashrc 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/40.bash: -------------------------------------------------------------------------------- 1 | printf 'Hello, %s!\n' "$USER" 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/41.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/41.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/42.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/42.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/43.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf 'Hello, %s!\n' "$USER" 3 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/44.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/44.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/45.bash: -------------------------------------------------------------------------------- 1 | bash$ chmod +x hello.bash 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/46.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/46.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/47.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/47.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/48.bash: -------------------------------------------------------------------------------- 1 | bash$ file /usr/bin/ldd 2 | Bourne-Again shell script, ASCII text executable 3 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/49.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/49.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/50.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/50.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/51.bash: -------------------------------------------------------------------------------- 1 | bash$ sudo -s 2 | Password: 3 | bash# mv hello /usr/local/bin 4 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/52.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/52.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/53.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/53.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/54.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/54.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/55.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/55.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/56.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/56.bash -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/57.bash: -------------------------------------------------------------------------------- 1 | PATH=$PATH:/home/bashuser/bin 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/58.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | -------------------------------------------------------------------------------- /07-scripts-functions-and-aliases/59.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/07-scripts-functions-and-aliases/59.bash -------------------------------------------------------------------------------- /08-best-practices/01.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/01.bash -------------------------------------------------------------------------------- /08-best-practices/02.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/02.bash -------------------------------------------------------------------------------- /08-best-practices/03.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/03.bash -------------------------------------------------------------------------------- /08-best-practices/04.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/04.bash -------------------------------------------------------------------------------- /08-best-practices/05.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/05.bash -------------------------------------------------------------------------------- /08-best-practices/06.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/06.bash -------------------------------------------------------------------------------- /08-best-practices/07.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/07.bash -------------------------------------------------------------------------------- /08-best-practices/08.bash: -------------------------------------------------------------------------------- 1 | $ cp "$myvar" destdir 2 | -------------------------------------------------------------------------------- /08-best-practices/09.bash: -------------------------------------------------------------------------------- 1 | cp: invalid option -- 'h' 2 | -------------------------------------------------------------------------------- /08-best-practices/10.bash: -------------------------------------------------------------------------------- 1 | $ cp -- "$myvar" destdir 2 | -------------------------------------------------------------------------------- /08-best-practices/11.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/11.bash -------------------------------------------------------------------------------- /08-best-practices/12.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/12.bash -------------------------------------------------------------------------------- /08-best-practices/13.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/13.bash -------------------------------------------------------------------------------- /08-best-practices/14.bash: -------------------------------------------------------------------------------- 1 | $ myscript 2 | -------------------------------------------------------------------------------- /08-best-practices/15.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/15.bash -------------------------------------------------------------------------------- /08-best-practices/16.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/16.bash -------------------------------------------------------------------------------- /08-best-practices/17.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | read -p 'Now editing your configuration file (press ENTER): ' 3 | "${VISUAL:-vi}" -- "$HOME"/.myscriptrc 4 | -------------------------------------------------------------------------------- /08-best-practices/18.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/18.bash -------------------------------------------------------------------------------- /08-best-practices/19.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/19.bash -------------------------------------------------------------------------------- /08-best-practices/20.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/20.bash -------------------------------------------------------------------------------- /08-best-practices/21.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/21.bash -------------------------------------------------------------------------------- /08-best-practices/22.bash: -------------------------------------------------------------------------------- 1 | $ cat ~/.myscriptrc 2 | createdir=yes 3 | -------------------------------------------------------------------------------- /08-best-practices/23.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/23.bash -------------------------------------------------------------------------------- /08-best-practices/24.bash: -------------------------------------------------------------------------------- 1 | IFS=: read -r name address 2 | -------------------------------------------------------------------------------- /08-best-practices/25.bash: -------------------------------------------------------------------------------- 1 | cd -- "$HOME"/src/bash || exit 2 | git fetch 3 | -------------------------------------------------------------------------------- /08-best-practices/26.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/26.bash -------------------------------------------------------------------------------- /08-best-practices/27.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/27.bash -------------------------------------------------------------------------------- /08-best-practices/28.bash: -------------------------------------------------------------------------------- 1 | git -C "$HOME"/src/bash fetch 2 | -------------------------------------------------------------------------------- /08-best-practices/29.bash: -------------------------------------------------------------------------------- 1 | /bin/sed '/^$/d' data 2 | -------------------------------------------------------------------------------- /08-best-practices/30.bash: -------------------------------------------------------------------------------- 1 | # Terrible code; never do this! 2 | SED=$(which sed) 3 | $SED '/^$d/' data 4 | -------------------------------------------------------------------------------- /08-best-practices/31.bash: -------------------------------------------------------------------------------- 1 | sed '/^$/d' data 2 | -------------------------------------------------------------------------------- /08-best-practices/32.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/32.bash -------------------------------------------------------------------------------- /08-best-practices/33.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/33.bash -------------------------------------------------------------------------------- /08-best-practices/34.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/34.bash -------------------------------------------------------------------------------- /08-best-practices/35.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/35.bash -------------------------------------------------------------------------------- /08-best-practices/36.bash: -------------------------------------------------------------------------------- 1 | date +%s > "${TMPDIR:-/tmp}"/myscript-timestamp 2 | -------------------------------------------------------------------------------- /08-best-practices/37.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/37.bash -------------------------------------------------------------------------------- /08-best-practices/38.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/38.bash -------------------------------------------------------------------------------- /08-best-practices/39.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/39.bash -------------------------------------------------------------------------------- /08-best-practices/40.bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/08-best-practices/40.bash -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Bash-Quick-Start-Guide/HEAD/README.md --------------------------------------------------------------------------------