Exam 702-100 Topic 5 Question 25 Discussion
Actual exam question for Lpi's 702-100 exam
Question #: 25
Topic #: 5
Question #: 25
Topic #: 5
What does S l represent in the following lines from a Bourne shell script:
#! /bin/sh
cp SI 52
#! /bin/sh
cp SI 52
Suggested Answer: D Vote an answer
Explanation
The command cp SI 52 in the Bourne shell script copies the file named by the value of SI to the file named 52.
The SI is a positional parameter that represents the first argument passed to the script when it is executed.
Positional parameters are numbered from 1 to 9, and can be accessed by using the dollar sign $ followed by the number. For example, $1 is the first positional parameter, $2 is the second, and so on. Therefore, the SI in the script is equivalent to $1, and it represents the first argument passed to the script. The correct answer is D.
A positional parameter. References:
[Positional Parameters - FreeBSD]
[Shell Scripting Tutorial - Positional Parameters]
The command cp SI 52 in the Bourne shell script copies the file named by the value of SI to the file named 52.
The SI is a positional parameter that represents the first argument passed to the script when it is executed.
Positional parameters are numbered from 1 to 9, and can be accessed by using the dollar sign $ followed by the number. For example, $1 is the first positional parameter, $2 is the second, and so on. Therefore, the SI in the script is equivalent to $1, and it represents the first argument passed to the script. The correct answer is D.
A positional parameter. References:
[Positional Parameters - FreeBSD]
[Shell Scripting Tutorial - Positional Parameters]
by Walter at Mar 17, 2025, 02:04 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).