/var/tmp/exercise-two/Alice/likes/an-ox <---- a file /var/tmp/exercise-two/Emily/has-bought/a-horse <---- a file /var/tmp/exercise-two/Gary/has-bought/a-rhino <---- a directory /var/tmp/exercise-two/Gary/has-bought/a-rhino/less <---- a file /var/tmp/exercise-two/Gary/has-bought/a-rhino/is <---- a file /var/tmp/exercise-two/Gary/has-bought/a-rhino/more <---- a file /var/tmp/exercise-two/Mary/is/a-snake <---- a file則在你的 exer2 下建立如下對應的結構.
~/unix-1071/exer2/ |---Alice/ | `---likes/ | `---an-ox |---Emily/ | `---has-bought/ | `---a-horse |---Gary/ | `---has-bought/ | `---a-rhino/ | |---is | |---less | `---more `---Mary/ `---is/ `---a-snake注意: 若是檔案的話, 內容必須一樣, 也就是說要用複製的.
$ ./a.out 3 # move 3 discs, from A to C by B from A to C from A to B from C to B from A to C from B to A from B to C from A to C $ ./a.out 2 # move 2 discs, from A to C by B from A to B from A to C from B to C $
$ cat Week-1 # this is a comment klim 120 100 900 milk 98 33 100 120 moo 10000 200 20 # this is a comment too. cow 2000 10 100000 $ cat Week-2 moo 20 100 20 1 cow 299 44 22 cow 333 22 90 klim 49 22 moo 333 $ ./ex7.sh moo Week-1 moo has total 10220 dollars. $ ./ex7.sh moo Week-1 Week-2 moo has total 10694 dollars. $ ./ex7.sh moo moo 1000 cow 200 moo 20 40 30 moo has total 1090 dollars. $
$ ./ex8.awk -v name=name-to-search [file1 file2 .... ] $ ./ex8.awk -v name=moo Week-1 $ ./ex8.awk -v name=moo Week-1 Week-2 $ ./ex8.awk -v name=moo
$ ps -e -o pid,user | ./ex9.awk klim: 8536 8537 8769 8770 mail: 848 messagebus: 619 apache: 750 751 752 24257 nobody: 9152 smmsp: 737 daemon: 709 s106321001: 379 32536 root: 1 2 3 5 7 8 9 10 11 12 13 14 15 16 17 18 19 21 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 112 113 114 115 116 117 118 120 121 122 123 124 125 126 129 130 131 132 133 165 276 277 357 358 359 360 361 362 363 364 396 400 449 450 574 580 591 606 622 691 707 734 749 835 849 850 851 852 853 854 8449 8533 8614 20988 26395 32535 $