├── 'Awk'-1.sh ├── 'Awk'-2.sh ├── 'Awk'-3.sh ├── 'Awk'-4.sh ├── 'Grep'-#1.sh ├── 'Grep'-#2.sh ├── 'Grep'-#3.sh ├── 'Grep'-A.sh ├── 'Grep'-B.sh ├── 'Sed'-command-#1.sh ├── 'Sed'-command-#2.sh ├── 'Sed'-command-#3.sh ├── 'Sed'-command-#4.sh ├── 'Sed'-command-#5.sh ├── 'Tr'-Command-#1.sh ├── 'Tr'-Command-#2.sh ├── 'Tr'-Command-#3.sh ├── A-Personalized-Echo.sh ├── Arithmetic-Operations.sh ├── Comparing-Numbers.sh ├── Compute-the-Average.sh ├── Concatenate-an-array-with-itself.sh ├── Count-the-number-of-elements-in-an-Array.sh ├── Cut-#1.sh ├── Cut-#2.sh ├── Cut-#3.sh ├── Cut-#4.sh ├── Cut-#5.sh ├── Cut-#6.sh ├── Cut-#7.sh ├── Cut-#8.sh ├── Cut-#9.sh ├── Display-an-element-of-an-array.sh ├── Filter-an-Array-with-Patterns.sh ├── Getting-started-with-conditionals.sh ├── Head-of-a-Text-File-#1.sh ├── Head-of-a-Text-File-#2.sh ├── Lets-Echo.sh ├── Lonely-Integer-Bash!.sh ├── Looping-and-Skipping.sh ├── Looping-with-Numbers.sh ├── Middle-of-a-Text-File.sh ├── More-on-Conditionals.sh ├── Paste-#1.sh ├── Paste-#2.sh ├── Paste-#3.sh ├── Paste-#4.sh ├── Read-in-an-Array.sh ├── Remove-the-First-Capital-Letter-from-Each-Element.sh ├── Slice-an-Array.sh ├── Sort-#1.sh ├── Sort-#2.sh ├── Sort-#3.sh ├── Sort-#4.sh ├── Sort-#5.sh ├── Sort-#6.sh ├── Sort-#7.sh ├── Tail-of-a-Text-File#1.sh ├── Tail-of-a-Text-File-#2.sh ├── The-World-of-Numbers.sh ├── Uniq-#1.sh ├── Uniq-#2.sh ├── Uniq-#3.sh └── Uniq-#4.sh /'Awk'-1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Awk'-1.sh -------------------------------------------------------------------------------- /'Awk'-2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Awk'-2.sh -------------------------------------------------------------------------------- /'Awk'-3.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Awk'-3.sh -------------------------------------------------------------------------------- /'Awk'-4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Awk'-4.sh -------------------------------------------------------------------------------- /'Grep'-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | grep -w "the" -------------------------------------------------------------------------------- /'Grep'-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | grep -wi "the" -------------------------------------------------------------------------------- /'Grep'-#3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | grep -vi "that" -------------------------------------------------------------------------------- /'Grep'-A.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Grep'-A.sh -------------------------------------------------------------------------------- /'Grep'-B.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Grep'-B.sh -------------------------------------------------------------------------------- /'Sed'-command-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -e 's/\bthe\b/this/' $1 -------------------------------------------------------------------------------- /'Sed'-command-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -e 's/thy/your/ig' $1 -------------------------------------------------------------------------------- /'Sed'-command-#3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -e 's/[tT]hy/{&}/ig' $1 -------------------------------------------------------------------------------- /'Sed'-command-#4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Sed'-command-#4.sh -------------------------------------------------------------------------------- /'Sed'-command-#5.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Sed'-command-#5.sh -------------------------------------------------------------------------------- /'Tr'-Command-#1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Tr'-Command-#1.sh -------------------------------------------------------------------------------- /'Tr'-Command-#2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Tr'-Command-#2.sh -------------------------------------------------------------------------------- /'Tr'-Command-#3.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/'Tr'-Command-#3.sh -------------------------------------------------------------------------------- /A-Personalized-Echo.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/A-Personalized-Echo.sh -------------------------------------------------------------------------------- /Arithmetic-Operations.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Arithmetic-Operations.sh -------------------------------------------------------------------------------- /Comparing-Numbers.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Comparing-Numbers.sh -------------------------------------------------------------------------------- /Compute-the-Average.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Compute-the-Average.sh -------------------------------------------------------------------------------- /Concatenate-an-array-with-itself.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Concatenate-an-array-with-itself.sh -------------------------------------------------------------------------------- /Count-the-number-of-elements-in-an-Array.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | 5 | echo ${#ary[@]} -------------------------------------------------------------------------------- /Cut-#1.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Cut-#1.sh -------------------------------------------------------------------------------- /Cut-#2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Cut-#2.sh -------------------------------------------------------------------------------- /Cut-#3.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Cut-#3.sh -------------------------------------------------------------------------------- /Cut-#4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Cut-#4.sh -------------------------------------------------------------------------------- /Cut-#5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cut -f 1-3 $1 4 | -------------------------------------------------------------------------------- /Cut-#6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cut -c 13- $1 4 | -------------------------------------------------------------------------------- /Cut-#7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cut -d ' ' -f4 $1 4 | -------------------------------------------------------------------------------- /Cut-#8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cut -d ' ' -f 1-3 $1 -------------------------------------------------------------------------------- /Cut-#9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cut -f 2- $1 -------------------------------------------------------------------------------- /Display-an-element-of-an-array.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | 5 | echo ${ary[3]} -------------------------------------------------------------------------------- /Filter-an-Array-with-Patterns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | 5 | echo ${ary[@]/*[aA]*/} -------------------------------------------------------------------------------- /Getting-started-with-conditionals.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Getting-started-with-conditionals.sh -------------------------------------------------------------------------------- /Head-of-a-Text-File-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | head -20 $1 -------------------------------------------------------------------------------- /Head-of-a-Text-File-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | head -c 20 $1 -------------------------------------------------------------------------------- /Lets-Echo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "HELLO" -------------------------------------------------------------------------------- /Lonely-Integer-Bash!.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Lonely-Integer-Bash!.sh -------------------------------------------------------------------------------- /Looping-and-Skipping.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Looping-and-Skipping.sh -------------------------------------------------------------------------------- /Looping-with-Numbers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in {1..50} 4 | do 5 | echo $i 6 | done 7 | -------------------------------------------------------------------------------- /Middle-of-a-Text-File.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | head -22 $1 | tail -11 -------------------------------------------------------------------------------- /More-on-Conditionals.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/More-on-Conditionals.sh -------------------------------------------------------------------------------- /Paste-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | paste -sd ';' -------------------------------------------------------------------------------- /Paste-#2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Paste-#2.sh -------------------------------------------------------------------------------- /Paste-#3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | paste -sd '\t' -------------------------------------------------------------------------------- /Paste-#4.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/Paste-#4.sh -------------------------------------------------------------------------------- /Read-in-an-Array.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | echo ${ary[@]} -------------------------------------------------------------------------------- /Remove-the-First-Capital-Letter-from-Each-Element.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | echo ${ary[@]/[[:upper:]]/.} -------------------------------------------------------------------------------- /Slice-an-Array.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readarray ary 4 | 5 | echo ${ary[@]:3:5} -------------------------------------------------------------------------------- /Sort-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | sort -------------------------------------------------------------------------------- /Sort-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | sort -r -------------------------------------------------------------------------------- /Sort-#3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | sort -n -------------------------------------------------------------------------------- /Sort-#4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat $1 | sort -rn -------------------------------------------------------------------------------- /Sort-#5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sort -t$'\t' -k2 -rn -------------------------------------------------------------------------------- /Sort-#6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sort -t$'\t' -k2 -n -------------------------------------------------------------------------------- /Sort-#7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sort -t'|' -k2 -rn -------------------------------------------------------------------------------- /Tail-of-a-Text-File#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tail -20 $1 -------------------------------------------------------------------------------- /Tail-of-a-Text-File-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tail -c 20 $1 -------------------------------------------------------------------------------- /The-World-of-Numbers.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sagarv26/HackerRank-Linux-Shell-Solution/HEAD/The-World-of-Numbers.sh -------------------------------------------------------------------------------- /Uniq-#1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uniq -------------------------------------------------------------------------------- /Uniq-#2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uniq -c | tr -s " " | cut -b 2- -------------------------------------------------------------------------------- /Uniq-#3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uniq -ic | tr -s " " | cut -b 2- -------------------------------------------------------------------------------- /Uniq-#4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uniq -u --------------------------------------------------------------------------------