/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-1101/exer2/ |---Alice/ | `---likes/ | `---an-ox |---Emily/ | `---has-bought/ | `---a-horse |---Gary/ | `---has-bought/ | `---a-rhino/ | |---is | |---less | `---more `---Mary/ `---is/ `---a-snake注意: 若是檔案的話, 內容必須一樣, 也就是說要用複製的.
$ cat IN-6 123 13 -9 23 1 2 3 3 4 9 8 $ ./exer6.sh < IN-6 -9 123 $
$ cat IN klim 120 oak -233 cat -999 goo 12 $ ./ex7.sh < IN max is klim, value = 120 min is cat, value = -999 $
Each set forms a line. So for every two lines your program will generate a line. The output should be a line consisted of elements of intersection set. And it should be sorted in ascending order, no duplication.
There is no space before the first number and after last number, and
only one space is used to separate two adjacent numbers.
If the intersection is empty, just show "empty".
$ cat IN-8 9 8 7 2 2 2 7 1 2 3 4 10 19 28 9 1 2 3 4 10 10 9 8 7 10 9 8 7 6 5 4 3 2 1 $ $ ./exer8.sh < IN-8 2 empty 7 8 9 10 $
$ ls IN-1 IN-4 IN-7 OUT-2 OUT-5 OUT-8 m.c IN-2 IN-5 IN-8 OUT-3 OUT-6 exer9.sh* minmax.c IN-3 IN-6 OUT-1 OUT-4 OUT-7 gen.sh* wrong.c $ $ ./exer9.sh ./exer9.sh xxxx.c $ $ ./exer9.sh hello.c hello.c not existed $ $ ./exer9.sh m.c a.out not generated successfully $ $ ./exer9.sh wrong.c test 1 ok test 2 ok test 3 fail test 4 fail test 5 ok test 6 ok test 7 fail test 8 fail $ $ ./exer9.sh minmax.c test 1 ok test 2 ok test 3 ok test 4 ok test 5 ok test 6 ok test 7 ok test 8 ok $
$ cat IN-10 # this is a comment joejoejoe 10 20 30 #this is also a comment OAK -999 10 # 10000 joeJOE 2000 oak 10 milk 1000 # 2000 $ ./ex10.awk IN-10 OAK = -326.33 MILK = 1000.00 JOEJOE = 515.00 $