Part 1 Multiple Choice(20 points) Note: Each question may have one or more answe
ID: 3686716 • Letter: P
Question
Part 1 Multiple Choice(20 points) Note: Each question may have one or more answers 1. In a bash script, the correct way(s) to define a function is(are): void foo( int foo(numxtunction tool foo(numX return $num 2. In a bash script, the correct way(s) to call a function which named foo is(are): (A) function foo0 (B) foo (C) foo) (D) use foo 3. In the following commands, which one(s) can write the output both to the stdout(screen) and file. (A) Is > list.bxt (B) Is >> list.txt (C) (Is> list.txt;cat list.txt) (D) Is I cat> list.bxt 4. In the following commands, which one(s) will invoke a subshell. (A) echo today is 'date (B) (cat input)> out (C) Is & (D) Is:pwd; 5. To inhibit variable substitution replacement when echoing a string, we can use. (A) Grave accent (B) Single quotes (C) Double quotes (D) None of above 2 ofExplanation / Answer
1. D.
2. B.
3. C.
4. B.
5. B.
6. A, B.
7. A.
8. B.
9. D.