[i=s] 本帖最后由 linuxcui 于 2010-1-12 09:01 编辑 [/i]
题目出自LPI102考题,第一个全答对的朋友奖励棒球帽一个,大家可以直接跟贴。如果对获得的奖励采取保留,那将累计奖品,计算入年度大奖,具体大奖是什么,反正不会失望。嘿嘿。
本期有效期到周三下午四点截止。
1、Which command will output the exit status of the previous command (a 1 or a 0)?
A. echo $?
B. echo $1
C. echo $EXIT
D. exitstatus
2、The content of the ~/myscript.sh file is as follows:
shift echo $2
What will be the output of the command: ~/myscript.sh alpha beta gamma delta?
3、Writing a shell script you want to check if the file foobar exists and is owned by the user who runs the script. Which of the following test commands will check this?
A. test -e foobar
B. test -r foobar
C. test -b foobar
D. test -o foobar
E. test -O foobar
4、You are writing a script and want to test the exit status of a process. Which of the following is true?
A. The normal exit value differs
B. You can’t test the normal exit value
C. The normal exit value is $EXIT
D. The normal exit value is 0
5、In the following command and its output, echo $$
12942
What is 12942?
A. the process ID of the echo command
B. the process ID of the current shell
C. the process ID of the last command excuted
D. The process ID of the last backgrounded command
6、Which of the following is the best way to list all defined shell variables?
A. env
B. set
C. env -a
D. echo $ENV
7、You create a script named "/tmp/src" that runs under the bash shell. When you try to invoke it by typing "/tmp/scr", you get an error message saying "bash: /tmp/src: Permission denied". What could be wrong? Select the best response.
A. The script file was probably deleted by another user
B. The path for the bash shell is wrong in the first line
C. The permissions on the script file deny execute access
D. The script should be moved to the user’s home directory
E. Users are not allowed to execute scripts from the /tmp directory
8、What is described by the PS1 and PS2 environment variable?
A. Postscript Level 1 and Level 2 capabilities
B. Shortcuts for the commands "ps" and "ps uax"
C. The different levels for the Power Save Mode
D. The normal prompt and the following prompt of the shell
E. PS2 is a link to the mouse-port of a ps/2 mouse, PS1 doesn't exist
9、Which of the statements is the result of the following command? export PS2=”[\u\w]\\$ ”
A. The primary bash prompt uses underlining and white background (black foreground)
B. The primary bash prompt includes the username and working path
C. The secondary bash prompt terminal prompt uses underlining and white background (black foreground)
D. The secondary bash prompt includes the username and working path
E. The bash prompt maps mouse button one as Ctrl-U (undo) and mouse two as Ctrl-W (write line to file)
10、What is the correct first line of any bash shell script? A. #!/bin/bash
B. #!
C. /bin/bash
D. /#!/bin/bash
E. #
shentu 于 2010-06-10 11:47:04发表:
学习了
linuxcui 于 2010-01-12 09:04:56发表:
3# 绿色圣光
圣光的完全正确,四期测试,你已经完全答对了两次~~可是你还没给快递地址,给我留言哦~~
绿色圣光 于 2010-01-11 23:07:00发表:
[hide]A
gamma
E
D
B
B
C
D
D
A[/hide]
看来自己对shell掌握地还不行啊……
猴子250 于 2010-01-11 16:29:41发表:
初学者看热闹~~争取以后能都答对,嘿嘿