Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation LFCS Exam - Topic 8 Question 54 Discussion

Posted by Gail on Mar 01, 2023 at 03:27 PM

Which of the following commands puts the output of the command date into the shell variable mydate?

Suggested Answer: E

Get Premium LFCS Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
36 comments · newest first
AN
Anika 12 months ago
Really? I didn't know about the $() syntax!
MI
Micaela 1 year ago
I thought it was C at first, but A makes more sense.
PH
Phuong 1 year ago
Wait, isn't B also a valid command?
EM
Emerson 1 year ago
Totally agree, A is the way to go.
CA
Caitlin 1 year ago
A is the correct answer!
EL
Elinore 1 year ago
I thought it was just a simple assignment, so maybe D? But now I'm second-guessing myself.
CA
Catherin 1 year ago
I feel like B could be a trick option, but I can't recall if exec works that way for variable assignment.
AN
Andra 1 year ago
I remember practicing something similar where we had to capture command output. A seems to fit that.
VI
Viola 1 year ago
I think it's definitely A, but I'm not entirely sure if the syntax is correct.
JU
Jutta 1 year ago
Ah, this is the kind of question I feel confident about. Machines are definitely the best option for handling repetitive, accuracy-focused tasks. I'll select that answer without hesitation.
HE
Hester 1 year ago
I think miners get incentivized with cryptocurrency, but I'm not entirely sure if it's only that or if there's more to it.
AL
Alpha 1 year ago
I remember studying about SNMP and syslog in context, but I don't see how they apply to quarantining endpoints directly.
ER
Erasmo 1 year ago
I feel like the low number of devices connected to the network isn't a major issue. But I could be mixing it up with another topic we covered.
NU
Nu 1 year ago
Okay, let me think this through step-by-step. I need to calculate the tax impact of selling the old grinder and purchasing the new one.
DW
Dwight 1 year ago
Option E with '${date}' is probably a typo, since date is not a shell variable by default.
RO
Rolande 1 year ago
Option D is just assigning the literal string 'date' to the variable, which won't work.
FR
Francisca 1 year ago
↳ replying to Rolande
E) mydate=\'${date}\'
CA
Carin 1 year ago
↳ replying to Rolande
C) mydate=\'$((date))\'
DE
Devora 1 year ago
↳ replying to Rolande
B) mydate=\'exec date\'
GL
Glenn 1 year ago
↳ replying to Rolande
A) mydate=\'$(date)\'
SA
Sarina 2 years ago
Option C with '$((date))' looks like it might be trying to use date as a mathematical expression, which doesn't make sense here.
EL
Eladia 1 year ago
↳ replying to Sarina
E) mydate=\'${date}\'
AN
Antione 1 year ago
↳ replying to Sarina
I think option A is the correct one.
MA
Margurite 1 year ago
↳ replying to Sarina
A) mydate=\'$(date)\'
TA
Tawna 2 years ago
I'm not sure about option B, 'exec date' seems like it might actually execute the date command rather than capturing its output.
HO
Hollis 1 year ago
↳ replying to Tawna
User 3: Yeah, option B might actually execute the date command instead of capturing its output.
CO
Corinne 1 year ago
↳ replying to Tawna
User 2: I agree, using $(date) will capture the output of the date command.
CA
Candra 2 years ago
↳ replying to Tawna
User 1: I think option A is the correct one.
CH
Chery 2 years ago
Option A looks good, using command substitution to capture the output of the date command.
KA
Kandis 1 year ago
↳ replying to Chery
No, option E won't work. You need to use command substitution like in option A.
SA
Samuel 1 year ago
↳ replying to Chery
E) mydate=\'${date}\'
NI
Niesha 2 years ago
↳ replying to Chery
Yes, that's correct. Option A captures the output of the date command.
LO
Louis 2 years ago
↳ replying to Chery
A) mydate=\'$(date)\'
CH
Charlie 2 years ago
I'm not sure, but I think it's either A) or E) because they both involve capturing the output of the date command
BO
Bobbie 2 years ago
I agree with Novella, because using $(date) will capture the output of the date command
NO
Novella 2 years ago
I think the answer is A) mydate=$(date)
0/2000 characters

Save Cancel