basicsys@mars~/lec4>cat F1 a:b:c:d:e:f 1234:5678 xyz:::::::rqw abc def gg 1234 basicsys@mars~/lec4>cut -d":" -f3,5-7 F1 c:e:f ::: abc def gg 1234 basicsys@mars~/lec4>cut -s -d":" -f3,5-7 F1 c:e:f ::: basicsys@mars~/lec4>cut -d":" -f3,5-7 -s F1 c:e:f ::: basicsys@mars~/lec4>cut -s -d":" -f3,5-7 --output-delimiter="xyz" F1 cxyzexyzf xyzxyzxyz basicsys@mars~/lec4>cat P1 read x y=$(wc -l $x) echo $y >|F2 cut -d" " -f1 F2 basicsys@mars~/lec4>chmod u+x P1 basicsys@mars~/lec4>P1 F1 5 basicsys@mars~/lec4>cat F1 a:b:c:d:e:f 1234:5678 xyz:::::::rqw abc def gg 1234 basicsys@mars~/lec4>cat P1 read x wc -l $x >|F2 cut -d" " -f1 F2 basicsys@mars~/lec4>P1 F1 5 basicsys@mars~/lec4>cat P1 read x while [ $x -ge 1 ] do echo $x x=$[$x-1] done basicsys@mars~/lec4>P1 6 6 5 4 3 2 1 basicsys@mars~/lec4>cat P1 read x if [ $x -gt 5 ] then echo "the number you entered is greater than 5" else echo "the number you entered is less than or equal 5" fi basicsys@mars~/lec4>cat P1 read x wc -l $x >|F2 y=$(cut -d" " -f1 F2) sum=0 while [ $y -ge 1 ] do head -$y $x >| F2 z=$(tail -1 F2) sum=$[$sum+$z] y=$[$y-1] done echo $sum basicsys@mars~/lec4>cat F1 10 100 3 20 basicsys@mars~/lec4>P1 F1 133 basicsys@mars~/lec4>cat P1 read x sum=0 while read z do sum=$[$sum+$z] done< $x echo $sum basicsys@mars~/lec4>P1 F1 133