- Home
- Server Administration
- LPIC-1 Linux Administrator 102
71.
Which of the following lines identify valid shell scripts on a normally configured system?
(Select two.)
- A.#!/bin/script
- B.#!/bin/bash
- C.!#/bin/tcsh
- D.#!/bin/sh
- E.!#/bin/zsh
- Answer & Explanation
- Report
Answer : [B, D]
Explanation :
Explanation :
72.
Which of the following are valid looping statements in bash shell scripting? (Select three.)
- A.for
- B.while
- C.goto
- D.until
- E.case
- Answer & Explanation
- Report
Answer : [A, B, D]
Explanation :
Explanation :
The for, while, and until statements are all valid looping statements in bash, so options A, B, and D are all correct. There is no goto statement in bash’s scripting language, so option C is incorrect. The case statement is a conditional, not a looping, statement in bash, so option E is incorrect. |
73.
Your SMTP email server, mail.luna.edu, receives a message addressed to postmaster@
mail.luna.edu. There is no postmaster account on this computer. Assuming the system is
properly configured, how should the email server respond?
- A.Accept the message, but do so very slowly so as to tie up the sender’s resources.
- B.Bounce the message so that the sender knows the account doesn’t exist.
- C.Hold the message in the local mail queue until the postmaster account is created.
- D.Delete the message without bouncing it so as to reduce email clutter.
- E.Deliver the email to another account, either locally or on another computer.
- Answer & Explanation
- Report
Answer : [E]
Explanation :
Explanation :
All SMTP email servers are supposed to accept email to postmaster. Linux systems typically do so by using an alias to forward the email to another local user, or occasionally to a user on another computer. Thus, option E is correct. Option A would be rude and pointless in this case, although this type of response is used by some administrators when receiving mail from known spam sites, so as to degrade spammers’ operations. Options B and D both describe non-delivery of the message, in violation of proper email server configuration. Option C is effectively the same as option D unless creation of the postmaster account is imminent, and an email server would have no way of knowing this. |
74.
Which of the following is not a popular SMTP server for Linux?
- A.Postfix
- B.Sendmail
- C.Fetchmail
- D.Exim
- E.qmail
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The Fetchmail program is a tool for retrieving email from remote POP or IMAP servers and injecting it into a local (or remote) SMTP email queue. As such, it’s not an SMTP server, so option C is correct. Postfix (option A), sendmail (option B), Exim (option D), and qmail (option E) are all popular SMTP email servers for Linux. |
75.
You see the following line in a script:
mail -s “Error” -c abort < /tmp/msg root
What is the effect of this line, if and when it executes?
mail -s “Error” -c abort < /tmp/msg root
What is the effect of this line, if and when it executes?
- A.An email is sent to the user Error, the script is aborted using root privileges, and error messages are written to /tmp/msg.
- B.An email with the subject of Error and the contents from /tmp/msg is sent to the local users root and abort.
- C.An email with the subject of Error and the contents of /tmp/msg is sent to the local user root, and then the script is aborted.
- D.An email is sent with Error priority to the local user root, and the email system is then shut down with error messages being stored in /tmp/msg.
- E.An email with the subject of Error and contents of /tmp/msg is sent to root, and information on this is logged with priority abort.
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
The -s option to mail sets the message subject line, and -c sets carbon copy (cc:) recipients. Input redirection (via <) reads the contents of a line into mail as a message. A mail command line normally terminates with the primary recipient. Thus, option B correctly describes the effect of the specified line. Options A, C, D, and E are all confused in their interpretation of the effects of mail parameters. Options B and D also confuse input and output redirection, and option A incorrectly suggests that a script (or the mail program) can elevate its run status to root privileges. |