普华linux技术特点,来中标普华Linux专区测试一下你的Linux水平(之四)!

来中标普华Linux专区测试一下你的Linux水平(之四)!

发布时间:2010-01-11 15:47:34来源:红联作者:linuxcui

[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. #

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值