linux unix 2

Is this your test? Login to manage it. If not, you can create a quiz just like it.

This is a non-interactive preview of the quiz content.

1.
1 point
Which special BASH variable indicates the number of command line arguments passed to the script?
2.
1 point
In BASH, strings and numbers are compared the same way.
3.
1 point
To enter insert mode in the vi editor, we can use:
4.
1 point
Which operator sends the output from A into B while both programs are executing?
5.
1 point
Which file has the permissions 664?
6.
1 point
Which sequence in vi will quit the text editor without saving?
7.
1 point
The proper syntax to compare whether the string value of Variable X is greater than or equal t the string value of Variable Y is:
8.
1 point
Examine the code below:

#!/bin/bash

count=0
str=""
while [ $count -lt 10 ] ; do
str=$str-$count
let count=count+1
done
echo $str

How will the code be affected if we change the line: let count=count+1 ... to ... let $count=count+1?
9.
1 point
If the file foo.sh had 664 permissions, issuing
chmod +x foo.sh
would give the file ____ permissions
10.
1 point
Which of the following files is executable?
11.
1 point
Given the following code segment:

FOO="boo"
BAR=2323

What will be the output when the following statement executes:

echo "moo${FOO}/${BAR}${BAR}"
12.
1 point
Which test determines whether the file f1.txt is a directory?
13.
1 point
Which test determines whether the file f1.txt is a plain file?
14.
1 point
BASH is not capable of simple arithmetic operations.
15.
1 point
Given the following code segment:

FOO="boo"
BAR=2323

What will be the output when the following statement executes:

echo 'moo${FOO}/${BAR}${BAR}'
16.
1 point
Which special BASH variable can be used to view all command line arguments u-quoted?
17.
1 point
Which sequence in vi will quit the editor and save the file being edited?
18.
1 point
Which script will list individual words of a text file, such that one word is displayed per line?
Assume the text file comes in as a command line argument.
19.
1 point
Because of variable substitution, in BASH variables can be embedded in any string.
20.
1 point
What will be the output when the code below executes:

#!/bin/bash

count=0
str=""
while [ $count -lt 10 ] ; do
str=$str-$count
let count=count+1
done
echo $str
21.
1 point
Assume a script dumpThem.sh was called as:

./dumpThem.sh first second third fourth

What will be printed if the following code executes?

echo "$2$1"$4 $3
22.
1 point
Which file has permissions 775?
23.
1 point
In BASH, variables are implemented as names of the memory locations where values are stored.
24.
1 point
BASH commands can only be executed from a script file.
25.
1 point
Which test determines whether the file f1.txt exists
26.
1 point
Given the following code:

#!/bin/bash

What does that indicate?
27.
1 point
What will be the output of the command:

sysadmin@localhost:~$ cal
28.
1 point
It is much easier to export our work from VMWare than from Netacad.
29.
1 point
Which special BASH variable can be used to view the return code of the last command/program executed?
30.
1 point
Examine the code below:

#!/bin/bash

count=0
str=""
while [ $count -lt 10 ] ; do
str=$str-$count
let count=count+1
done
echo $str

How will the code be affected if we change the line: let count=count+1 ... to ... let count=$count+1?
31.
1 point
What will be the output of the command:

sysadmin@localhost:~$ echo $(cal)

issued Sunday 5/4/2-14
32.
1 point
In BASH, a variable holding a numeric value can be treated just like a string.
33.
1 point
Which is equivalent to: while [ $X -lt 10 ]
34.
1 point
What will be the output of the command:

sysadmin@localhost:~$ echo cal
35.
1 point
To enter command mode in vi editor, we use:
36.
1 point
Which command(s) will prompt the user to enter his/her age, such that the age is entered on the same line as the prompt?
37.
1 point
A command embedded in a string, will be replaced with its output, when the string is processed.
38.
1 point
$(foo) is equivalent to:
39.
1 point
The proper syntax to compare whether the numeric value of variable X is greater than or equal to the numeric value of Y is:
40.
1 point
What will be the output of the following command:
sysadmin@localhost:~$ echo ${cal}
41.
1 point
We would like to assign a value of 25 to the variable x. Which BASH statement will correctly accomplish that?
42.
1 point
If a BASH command does not execute successfully, it returns zero.
43.
1 point
If you have a script, myScript.sh, which is executed as:

./myScript.sh one two three four five

and there is a line of code:

echo "$# $@"

what will be output to the screen?
44.
1 point
Which return codes of a program are evaluated as true in BASH?
45.
1 point
Which is equivalent to: until [ $X =gt 10 ]
46.
1 point
To allow a script to execute like a command we must __________.
47.
1 point
Which special BASH variable ca be used to view all command line arguments, quoted?
48.
1 point
Which of the following files will not allow any access to the user who are not the owner and are not in the owner's group?
49.
1 point
${foo} is equivalent to:
50.
1 point
White space is important in BASH syntax.