J
J
John2021-01-24 01:43:23
linux
John, 2021-01-24 01:43:23

Deal with Linux script parameter?

0

You need to create a Parm directory. In the Parm directory, create a file called script1. script content:

-as a parameter in the script call line we specify the protocol name, control whether there is a parameter (before running the script, you must list the /etc/services file to select any protocol name).
-then you search for lines containing that name in the /etc/services file and only the content of the comment in the search line that is after the # character (if any) is displayed.

I can’t understand what the point is and how to do it ...

Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2021-01-24
@Derov

Wow, how did you sleep! "Then you search for strings..." :)
What's the problem?
Read the contents of the file.
Parsed line by line.
Inside the check of each line - one more parsing by the # symbol and checking if something was selected.
Output of the result
That's all, sit down, five.
Schoolboy is such a schoolboy. Then he will ask how to get a job as an enikey worker. And when they are puzzled to write something similar, but not as a training example, they will be horrified ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question