Victor Rodriguez
Test por , creado hace más de 1 año

105.1 Customize and use the shell environment 105.2 Customize or write simple scripts 105.3 SQL data management 108.3 Mail Transfer Agent (MTA) basics

35
0
0
Victor Rodriguez
Creado por Victor Rodriguez hace más de 7 años
Cerrar

Libro T9 - Writing Scripts, Configuring Email, and Using Databases

Pregunta 1 de 20

1

Which environment variable stores the format for the command prompt?

Selecciona una de las siguientes respuestas posibles:

  • A. PROMPT

  • B. PSI

  • C. PAGER

  • D. PS1

  • E. None of these variables store the format for the command prompt.

Explicación

Pregunta 2 de 20

1

You want to create a shortcut command for the command cd ~/papers/trade. Which of
the following lines, if entered in a bash startup script, will accomplish this goal?

Selecciona una de las siguientes respuestas posibles:

  • A. alias cdpt='cd ~/papers/trade'

  • B. export cdpt='cd ~/papers/trade'

  • C. alias cdpt 'cd ~/papers/trade'

  • D. alias cd 'cdpt ~/papers/trade'

  • E. env cdpt `cd ~/papers/trade`

Explicación

Pregunta 3 de 20

1

What is the purpose of the EDITOR environment variable?

Selecciona una de las siguientes respuestas posibles:

  • A. If it’s set to Y (the default), the shell environment permits editing of commands; if it’s
    set to N, such editing is disallowed.

  • B. It specifies the filename of the text editor that bash uses by default while you’re entering commands at its prompt.

  • C. If you type edit filename at a command prompt, the program specified by EDITOR
    will be launched.

  • D. If it’s set to GUI, programs call a GUI editor; if it’s set to TEXT, programs call a textbased editor.

  • E. Some programs refer to EDITOR to determine what external editor to launch when they
    need to launch one.

Explicación

Pregunta 4 de 20

1

In what environment variable is the current working directory stored?

Selecciona una de las siguientes respuestas posibles:

  • A. PATH

  • B. CWD

  • C. PWD

  • D. PRESENT

  • E. WORKING

Explicación

Pregunta 5 de 20

1

If typed in a bash shell, which of the following commands will create an environment variable called MYVAR with the contents mystuff that will be accessible to any created subshells?
(Choose all that apply.)

Selecciona una o más de las siguientes respuestas posibles:

  • A. export MYVAR='mystuff'

  • B. MYVAR='mystuff'

  • C. MYVAR='mystuff'; export MYVAR

  • D. echo $MYVAR mystuff

  • E. setenv MYVAR mystuff

Explicación

Pregunta 6 de 20

1

What file might a user modify to alter their own bash environment?

Selecciona una de las siguientes respuestas posibles:

  • A. /etc/inputrc

  • B. /etc/bashrc

  • C. $HOME/bashrc

  • D. $HOME/.profile_bash

  • E. ~/.bashrc

Explicación

Pregunta 7 de 20

1

What commands might you use (along with appropriate options) to learn the value of a
specific environment variable? (Select two.)

Selecciona una o más de las siguientes respuestas posibles:

  • A. env

  • B. DISPLAY

  • C. export

  • D. echo

  • E. cat

Explicación

Pregunta 8 de 20

1

Immediately after creating a shell script called a_script.sh in a text editor, which method
will not work to run the script?

Selecciona una de las siguientes respuestas posibles:

  • A. Typing bash a_script.sh at the command line.

  • B. Typing ./a_script.sh at the command line.

  • C. Typing . a_script.sh at the command line.

  • D. Typing source a_script.sh at the command line.

  • E. Any of the above will work.

Explicación

Pregunta 9 de 20

1

Describe the effect of the following short script, cp1.sh, if it’s called as cp1.sh big.c
big.cc:
#!/bin/bash
cp $2 $1

Selecciona una de las siguientes respuestas posibles:

  • A. It has the same effect as the cp command—copying the contents of big.c to big.cc.

  • B. It compiles the C program big.c and calls the result big.cc.

  • C. It copies the contents of big.cc to big.c, eliminating the old big.c.

  • D. It converts the C program big.c into a C++ program called big.cc.

  • E. It interprets the big.c and big.cc files as bash scripts.

Explicación

Pregunta 10 de 20

1

Where are the commands iterated by the loop located within the loop?

Selecciona una de las siguientes respuestas posibles:

  • A. Within the then statement section

  • B. Between the double semicolons (;;)

  • C. Within the case and esac constructs

  • D. Within the test statement

  • E. Between do and done constructs

Explicación

Pregunta 11 de 20

1

Which of the following lines identify valid shell scripts on a normally configured system?
(Select two.)

Selecciona una o más de las siguientes respuestas posibles:

  • A. #!/bin/script

  • B. #!/bin/bash

  • C. #!/bin/tcsh

  • D. !#/bin/sh

  • E. !#/bin/zsh

Explicación

Pregunta 12 de 20

1

Which of the following are valid looping statements in bash shell scripting? (Select all that apply.)

Selecciona una o más de las siguientes respuestas posibles:

  • A. for

  • B. while

  • C. if-then

  • D. until

  • E. case

Explicación

Pregunta 13 de 20

1

Your SMTP email server receives a message addressed to postmaster. The postmaster
username has an alias of john on this computer. Assuming that the system is properly configured, who will receive the email message?

Selecciona una de las siguientes respuestas posibles:

  • A. postmaster

  • B. john

  • C. The account listed in ~/.forward

  • D. root

  • E. No user, because an alias was set

Explicación

Pregunta 14 de 20

1

Which of the following is not a popular SMTP server for Linux?

Selecciona una de las siguientes respuestas posibles:

  • A. Postfix

  • B. Sendmail

  • C. Fetchmail

  • D. Exim

  • E. qmail

Explicación

Pregunta 15 de 20

1

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?

Selecciona una de las siguientes respuestas posibles:

  • 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.

Explicación

Pregunta 16 de 20

1

Your Internet connection has gone down for several hours. What command can you use to
check if there is a long list of jobs in the email queue?

Selecciona una de las siguientes respuestas posibles:

  • A. service sendmail status

  • B. lp -d queue ~/Maildir

  • C. sendmail -bq

  • D. mailq

  • E. ls /var/spool

Explicación

Pregunta 17 de 20

1

You examine your /etc/aliases file and find that it contains the following line:
root: jody
What can you conclude from this?

Selecciona una de las siguientes respuestas posibles:

  • A. Email addressed to jody on this system will be sent to the local user root.

  • B. Email addressed to root on this system will be sent to the local user jody.

  • C. The local user jody has broken into the system and has acquired root privileges.

  • D. The local user jody has permission to read email directly from root’s mail queue.

  • E. The administrator may log in using either username: root or jody.

Explicación

Pregunta 18 de 20

1

You’ve just installed MySQL and run it by typing mysql. How would you create a database
called fish to store data on different varieties of fish?

Selecciona una de las siguientes respuestas posibles:

  • A. Type NEW DATABASE fish; at the mysql> prompt.

  • B. Type CREATE DATABASE fish; at the mysql> prompt.

  • C. Type NEW DATABASE FISH; at the mysql> prompt.

  • D. Type DATABASE CREATE fish; at the mysql> prompt.

  • E. Type DB CREATE fish; at the mysql> prompt.

Explicación

Pregunta 19 de 20

1

Which of the following are true statements about SQL tables? (Select two.)

Selecciona una o más de las siguientes respuestas posibles:

  • A. Multiple tables may exist in a single SQL database.

  • B. Tables may be combined for cross-table searches using the DROP command.

  • C. Tables consist of rows, each of which holds attributes, and columns, each of which
    defines a specific database item.

  • D. Careful table design can reduce the amount of data entry and database storage size.

  • E. Tables are stored on disk using a lossy compression algorithm.

Explicación

Pregunta 20 de 20

1

What is the effect of the following SQL command, assuming the various names and
data exist?
mysql> UPDATE stars SET magnitude=2.25 WHERE starname='Mintaka';

Selecciona una de las siguientes respuestas posibles:

  • A. It returns database entries from the stars table for all stars with magnitude of 2.25
    and starname of Mintaka.

  • B. It sets the value of the stars field in the magnitude set to Mintaka, using a precision
    of 2.25.

  • C. It sets the value of the magnitude field to 2.25 for any item in the stars table with the
    starname value of Mintaka.

  • D. It combines the stars and magnitude=2.25 tables, returning all items for which the
    starname is Mintaka.

  • E. It updates the stars database, creating a new entry with a starname value of Mintaka
    and a magnitude of 2.25.

Explicación