Technion Bash Questions

The questions and solutions can be found here arrow-up-rightor on our moodle class website

Bash Special Variables – MyLinuxPlacearrow-up-right

Bash Scripting Tutorial for Beginners - LinuxConfig.orgarrow-up-right

Winter 2014 Moed A - Exam 15-1-a

exam-grades.txt

123 65
789 89
234 95

hmwk-grades.txt

123 70
234 80
789 100

Lets sort them by ID

$ cat exam-grades.txt hmwk-grades.txt | sort -n
123 65
123 70
234 80
234 95
789 100
789 89
  • -n Option : To sort a file numerically (here we want by ID).

  • Alphabetical order is the default (no flags)

Answer

My Solution looks a bit different

Winter 2015 Moed A - Exam 16-1-a

sed will read from line 2 until the end

Part Bet

Before let review the following:

Now lets explain

  • 1st arg- file name

  • rest - employee types

https://www.mylinuxplace.com/bash-special-variables/arrow-up-right

Last updated