Exam 10: Shell Scripting

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The pipe operator, which directs the output from one command to another, is

Free
(Multiple Choice)
4.8/5
(31)
Correct Answer:
Verified

C

Consider the following script. The output will be: #! /bin/bash guess = 2 start = 3 check = $     $start ÷2)+1)\div 2 ) + 1 ) ) if [ $guess -eq $check] then echo "Correct Guess: The number is $start" else echo "Sorry, wrong guess"

Free
(Multiple Choice)
4.7/5
(36)
Correct Answer:
Verified

A

The cat command in Linux is used to

Free
(Multiple Choice)
4.9/5
(30)
Correct Answer:
Verified

C

Consider the following script. The output will be newlines replaced by spaces):#! /bin/bash for number in {713}\{ 7 \ldots 1 \ldots 3 \} do echo snumber done

(Multiple Choice)
4.8/5
(51)

Shell scripts are

(Multiple Choice)
4.8/5
(44)

Comment lines in script begin with the character

(Multiple Choice)
4.8/5
(33)

File users.csv contains lines as: Christine:Riggs:christine.riggs@sunshine.edu. The command to extract emails from the file is

(Multiple Choice)
4.9/5
(43)

Consider the following script. The output will be newlines replaced by spaces): #! / bin/bash for number in {173}\{ 1 \ldots 7 \ldots 3 \} do echo $number done

(Multiple Choice)
4.7/5
(38)

A specific set of commands is to be executed 10 times. The most appropriate loop construct to accomplish this is

(Multiple Choice)
4.9/5
(29)

A user needs the following permissions to be able to use a script as a command

(Multiple Choice)
4.9/5
(30)

Shell scripts are used for

(Multiple Choice)
4.7/5
(30)

The command that will create a new variable in a bash script is

(Multiple Choice)
4.9/5
(29)

Consider the following script. The output will be newlines replaced by spaces for brevity): #! /bin/bash counter=1 while [ \$counter -le 5] do \quad echo $counter \quad counter=$counter +1)+ 1 ) ) done

(Multiple Choice)
4.7/5
(31)

An infinite loop a loop that runs forever can sometimes be useful

(True/False)
4.9/5
(36)

Consider the following script. The output will be newlines replaced by spaces for brevity): #! /bin/bash counter=1 while [ $counter -le 2] do echo $counter done

(Multiple Choice)
4.9/5
(33)

Consider the following script. The output will be: #! /bin/bash guess=2 check=$ $RANDOM ÷2)+1)\left. \left. \div 2 \right) + 1 \right) ) if [ $guess -eq $check] then echo "Correct Guess: The number is $check" else echo "Sorry, wrong guess"

(Multiple Choice)
4.8/5
(34)

The first line of an executable script needs to be #!/bin/bash, in order to

(Multiple Choice)
4.9/5
(37)

A specific set of commands is to be executed until a pre-specified condition is reached. The most appropriate loop construct to accomplish this is

(Multiple Choice)
4.8/5
(20)

In programming languages, loops are used to

(Multiple Choice)
4.9/5
(31)

Environment variables are

(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 25
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)