Answer the question
In order to leave comments, you need to log in
How to correctly translate the description of a case statement in bash?
Hello.
I am translating an article, but I cannot translate it correctly and clearly.
Part of the article (I highlighted in bold that I can’t translate so that the sentence looks normal):
The last of the important iteration loops is case. The case statement is used to
evaluate a number of expected values. The case statement in particular is important
in Linux startup scripts that on previous versions of RHEL were used to start
services. In a case statement, you define every specific argument that you expect, which
is followed by the command that needs to be executed if that argument was used.
In Listing 31.10 , you can see the blueprint of the case statement that was used on
RHEL 6 to start almost any service.
Here is the actual listing:
case "$1" in
start)
start;;
stop)
rm -f $lockfile
stop;;
restart)
restart;;
reload)
reload;;
status)
status
;;
*)
echo "Usage: $0 (start|stop|restart|reload|status)"
;;
esac
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question