Unix/Linux please. thank you 1. Assume the output of the date command is \'mon j
ID: 3743211 • Letter: U
Question
Unix/Linux please. thank you
1. Assume the output of the date command is 'mon jan 29 23:10:12 PST 2018'. The command to get output as - Date and Time: mon jan 29 23:10:12 PST 2018 is
a. echo "Date and Time: $date"
b. echo "Date and Time 'date'"
c. echo "Date and Time: `date`"
d. None of the above
2. Which of the following commands will output 21 (check all that apply)?
a. x=7; y=3; echo (( $x * $y ))
b. x=7; y=3; echo $(( $x * $y ))
c. x=7; y=3; echo $(( x * y ))
d. x=7; y=3; echo $x * $y
3. When the script foo -n -i bar[1-3] runs, what value does $# acquire? Consider that the files bar1, bar2 and bar3 already exist.
a. 3
b. 4
c. 5
d. 6
4. Which statement is used to handle relational comparisons in the if conditionals?
a. check
b. test
c. compare
d. equals
5. Consider the variable path=”/home/acs/home/acs/inbound/HERTZ_20170628.csv”. Which of the following statement will return the file name HERTZ_20170628.csv?
a. echo ${path#/*/}
b. echo ${path##/*/}
c. echo ${path%/*}
d. echo ${path%%/*}
6. To destroy an array in a shell script, which of the following commands would you use?
a. del arrayName
b. remove arrayName
c. unset arrayName
d. clear arrayName
Explanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only first question.
Ques 1. Answer : (c) echo "Date and Time: `date`"
Date and Time 'date'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.