Use correct syntax markup for shell

Approved by:	carlavilla
This commit is contained in:
Li-Wen Hsu 2021-03-14 20:08:55 +08:00
parent 55c95407aa
commit a9a9e66105
No known key found for this signature in database
GPG key ID: 8D7BCC7D012FD37E
666 changed files with 17924 additions and 17924 deletions

View file

@ -87,7 +87,7 @@ Things to note are:
➊ An interpreted script should begin with the magic "shebang" line. That line specifies the interpreter program for the script. Due to the shebang line, the script can be invoked exactly like a binary program provided that it has the execute bit set. (See man:chmod[1].) For example, a system admin can run our script manually, from the command line:
[source,bash]
[source,shell]
....
# /etc/rc.d/dummy start
....
@ -187,7 +187,7 @@ While examining [.filename]#rc.d# scripts, keep in mind that man:sh[1] defers th
====
You can make man:rc.subr[8] act as though the knob is set to `ON`, irrespective of its current setting, by prefixing the argument to the script with `one` or `force`, as in `onestart` or `forcestop`. Keep in mind though that `force` has other dangerous effects we will touch upon below, while `one` just overrides the ON/OFF knob. E.g., assume that `dummy_enable` is `OFF`. The following command will run the `start` method in spite of the setting:
[source,bash]
[source,shell]
....
# /etc/rc.d/dummy onestart
....
@ -365,7 +365,7 @@ Non-standard commands are not invoked during startup or shutdown. Usually they a
The full list of available commands can be found in the usage line printed by man:rc.subr[8] when the script is invoked without arguments. For example, here is the usage line from the script under study:
[source,bash]
[source,shell]
....
# /etc/rc.d/mumbled
Usage: /etc/rc.d/mumbled [fast|force|one](start|stop|restart|rcvar|reload|plugh|xyzzy|status|poll)
@ -550,7 +550,7 @@ What essential changes can we notice in the script?
➊ All arguments you type after `start` can end up as positional parameters to the respective method. We can use them in any way according to our task, skills, and fancy. In the current example, we just pass all of them to man:echo[1] as one string in the next line - note `$*` within the double quotes. Here is how the script can be invoked now:
[source,bash]
[source,shell]
....
# /etc/rc.d/dummy start
Nothing started.
@ -561,7 +561,7 @@ Greeting message: Hello world!
➋ The same applies to any method our script provides, not only to a standard one. We have added a custom method named `kiss`, and it can take advantage of the extra arguments not less than `start` does. E.g.:
[source,bash]
[source,shell]
....
# /etc/rc.d/dummy kiss
A ghost gives you a kiss.