basicsys@mars~/lec4>cat F1 a:b:c d:e:f 12345::ff:ss::g abc def gh abcdef 123456789abcd basicsys@mars~/lec4>cut -d":" -f3,6 F1 c d ff:g abc def gh abcdef 123456789abcd basicsys@mars~/lec4>cut -d":" -f1,5,6 F1 a:f 12345::g abc def gh abcdef 123456789abcd basicsys@mars~/lec4>cut -s -d":" -f1,5,6 F1 a:f 12345::g basicsys@mars~/lec4>cut -s -d":" -f1,5,6 --output-delimiter="xyz" F1 axyzf 12345xyzxyzg basicsys@mars~/lec4>cat P1 read x y=$(wc -l $x) echo $y >| F1 cut -d" " -f1 F1 basicsys@mars~/lec4>cat F1 a:b:c d:e:f 12345::ff:ss::g abc def gh abcdef 123456789abcd basicsys@mars~/lec4>P1 F1 5 basicsys@mars~/lec4>cat P1 read x if [ $x -gt 5 ] then echo $x is greater then 5 else echo $x is less then or equal to 5 fi basicsys@mars~/lec4>P1 20 20 is greater then 5 basicsys@mars~/lec4>P1 4 4 is less then or equal to 5 basicsys@mars~/lec4>P1 5 5 is less then or equal to 5 basicsys@mars~/lec4>P1 5.3 ./P1: line 2: [: 5.3: integer expression expected 5.3 is less then or equal to 5 basicsys@mars~/lec4>P1 a ./P1: line 2: [: a: integer expression expected a is less then or equal to 5 basicsys@mars~/lec4>cat P1 read x while [ $x -gt 5 ] do echo $x x=$[$x-1] done basicsys@mars~/lec4>P1 10 10 9 8 7 6 basicsys@mars~/lec4>cat P1 read x wc -l $x >|F2 y=$(cut -d" " -f1 F2) sum=0 while [ $y -gt 0 ] do head -$y $x >| F2 z=$(tail -1 F2) sum=$[$sum+$z] y=$[$y-1] done echo $sum basicsys@mars~/lec4>cat F1 20 30 4 100 basicsys@mars~/lec4>P1 F1 154 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 154 basicsys@mars~/lec4>mail nitzkk@gmail.com Subject: hello ffa dsfsfsd bad boy gddd . Cc: ofek678@gmail.com basicsys@mars~/lec4>cat F1 hi nitzan you are OK not bad boy basicsys@mars~/lec4>mail -s"hello" basicsys@mars.netanya.ac.il