/var/tmp/exercise-two/Bob/has-bought/a-cow /var/tmp/exercise-two/Bob/has-bought/a-deer /var/tmp/exercise-two/Bob/has-bought/a-dog /var/tmp/exercise-two/David/is/a-tiger /var/tmp/exercise-two/David/is/a-tiger/fun /var/tmp/exercise-two/David/is/a-tiger/is /var/tmp/exercise-two/David/is/a-tiger/it則在你的 exer2 下建立如下對應的結構.
~/unix-1122/exer2 |---Bob | `---has-bought | |---a-cow | |---a-deer | `---a-dog `---David `---is `---a-tiger |---fun |---is `---it
$ ./ex6-sum.sh 1 2 # number of argument != 3 usage: a b step $ ./ex6-sum.sh # number of argument != 3 usage: a b step $ ./ex6-sum.sh 1 2 3 # 1,4,7 ... ==> 1 1 $ ./ex6-sum.sh 1 2 1 # 1,2,3 ... ==> 1+2 = 3 3 $ ./ex6-sum.sh -10 -3 2 # -10,-8,... ==> -10-8... = -28 -28 $ ./ex6-sum.sh -10 -3 1 -52 $ ./ex6-sum.sh -10 -3 4 # -10,-6,-2,2,... ==> -10-6= -16 -16 $ ./ex6-sum.sh 10 -3 2 # 10 > -3, so 0 0 $ ./ex6-sum.sh 10 -3 -2 # 10,8,6,...-2,-4,.. ==> 10+8+...-2 = 28 28 $ ./ex6-sum.sh 10 -3 -4 # 10,6,2,-2,-6... ==> 10+6+2-2 = 16 16 $ ./ex6-sum.sh 10 -3 -6 12 $
$ ./ex7-extract.sh usage: ./ex7-extract.sh keyword [file] .... $ ./ex7-extract.sh klim OK it is not klim milk is milk klim got $1000 $1000 OK got is it not <----- ctrl-D pressed $ $ cat IN-a oak is not klim klim is good ok it is fine $ $ cat IN-b 192390 klim klim tooyoung ok it is fine $ $ ./ex7-extract.sh klim IN-a good is is not oak $ $ ./ex7-extract.sh klim IN-a IN-b 192390 good is is not oak tooyoung $