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 Exam LFCS Topic 5 Question 100 Discussion

Actual exam question for Linux Foundation's LFCS exam
Question #: 100
Topic #: 5
[All LFCS Questions]

The script, script.sh, consists of the following lines:

#!/bin/bash

echo $2 $1

Which output will appear if the command, ./script.sh test1 test2, is entered?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Mozelle
2 months ago
Alright, let's think this through. The script is echoing the arguments in reverse order, so B) test2 test1 is the correct output. Easy peasy, lemon squeezy!
upvoted 0 times
...
Alease
2 months ago
I'm not sure, but I think the answer is B) test2 test1 as well.
upvoted 0 times
...
Cory
2 months ago
This is a no-brainer! The script is just reversing the order of the arguments, so B has to be the right answer. *chuckles* Bash scripts, gotta love 'em!
upvoted 0 times
Erick
15 days ago
Bash scripts can be tricky, but this one is pretty straightforward.
upvoted 0 times
...
Janae
16 days ago
Yeah, that script is just swapping the arguments around.
upvoted 0 times
...
Gilbert
1 months ago
I think you're right, B) test2 test1 is the correct output.
upvoted 0 times
...
...
Bettyann
2 months ago
I agree with Laurel, because the script will echo the second argument first.
upvoted 0 times
...
Shaniqua
2 months ago
Let's see, the script is echoing the arguments in reverse order. That means B) test2 test1 is the correct answer. *fingers crossed*
upvoted 0 times
...
Shanice
2 months ago
I'm feeling confident about this one. The script is clearly just swapping the order of the arguments, so B is the way to go.
upvoted 0 times
Krissy
30 days ago
User 2: Yeah, that makes sense. The script is just swapping the arguments.
upvoted 0 times
...
Beata
1 months ago
User 1: I think it will output test2 test1.
upvoted 0 times
...
...
Coral
2 months ago
Woah, hold up! If the script is echoing the arguments in reverse order, then the answer has to be B. Easy peasy!
upvoted 0 times
...
Laurel
2 months ago
I think the output will be B) test2 test1.
upvoted 0 times
...
Glory
2 months ago
Hmm, this looks like a classic shell script argument handling question. I'll go with B) test2 test1.
upvoted 0 times
Laurena
21 days ago
User4: I agree with User2, it should be B) test2 test1.
upvoted 0 times
...
Nelida
22 days ago
User3: I'm not sure, but I think it might be C) script.sh test2.
upvoted 0 times
...
Latricia
2 months ago
User2: No, I believe it will be B) test2 test1.
upvoted 0 times
...
Roslyn
2 months ago
User1: I think the output will be A) test1 test2.
upvoted 0 times
...
...

Save Cancel