Home
You may like this!
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 : Valid shell scripts begin with the characters #! and the complete path to a program that can run the script. Options B and D both meet this description, because /bin/bash is a shell program that’s installed on virtually all Linux systems and /bin/sh is usually a link to /bin/bash or to some other valid shell. There is no standard /bin/script program, so option A is incorrect. Options C and E are both almost correct; /bin/tcsh and /bin/zsh are valid shells on many systems, but the order of the first two characters is reversed, so this option is incorrect.
Report
Name Email  
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 :
Using symbolic modes, the o+r option adds read (r) permissions to the world (o). Thus, option E is correct. Option A sets the mode to rwxr----x, which is a bit odd and doesn’t provide world read access to the file, although it does provide world execute access. Option B sets the mode to rw-r-----, which gives the world no access whatsoever to the file. Option C adds read access to the file for the owner (u) if the owner doesn’t already have this access; it doesn’t affect the world permissions. Option D removes read access for all users, so it’s incorrect.
Report
Name Email  
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 :
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.
Report
Name Email  
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 :
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.
Report
Name Email  
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?
  • 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 :
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.
Report
Name Email