Use case statements in Shell programming, and use case statements in shell programming
Hello everyone, today we bring you the use of Shell programming case statements!
In fact, the case statement is quite understandable. In shell programming, the if
70. Function in shell, array in shell, demand analysis of alarm systemI. Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit
LInux's Shell has a set of its own flow control statements, including conditional statements (IF), loop statements (For,while), which have a great effect on our usual scripting and command input, which will certainly help us a lot. I. IFIf is a
Summary of the for Loop in Shell
This article mainly introduces the for loop summary in Shell. This article describes the usage of for loop in shell and several methods of for loop in shell. for more information, see
There are a lot of for loop
If, case, for, while, until, shellcase in Shell scripts
If condition test statement
If-then-fiIn the if condition test statement, the command following the if statement is run ).If the exit status code of the command is 0, the command in the then
Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly. Format: function F_name () {Command}The function has to be on the
20.16-20.17 functions in the shell
The function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.
格式: function f_name() {
Non-interactive password modification in Shell scripts and non-Password modification in shell scriptsToday, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is obviously not
8. find in shell commands and find in shell commands
The find command, which is commonly used like cd. however, most of the time, one or two parameters are enough. or, barely enough. however, when we take the initiative to look at the find manual,
When using single quotes, double quotes, and reverse quotes in shell scripts, special symbols such as single quotes, double quotes, and reverse quotes are often used. They play different roles in shell, but are prone to misuse and confusion. Briefly
Speaking of function calling, I believe everyone will not be unfamiliar with it. However, for me new to shell, the function calling method in shell is a bit difficult for me and I have taken a lot of detours, because a "natural" error occurred while
I really don't know how to write this article name about trap and expr in shell, so I just wrote such a strange name. It is about trap and expr. Trap and expr are two commands in shell, which should be familiar to everyone, that is, the four
Case commands in shell in Linux (regular break, unconditional continuation, and conditional continuation)
In linux, the case name in shell is similar to the switch in C/C ++, but the case in shell is more powerful and complex.
1. The power mainly
20.16/20.17 functions in the shellImplicit functions for displaying variablesResults of executionparameter is only one 1, the result of the first is 1, the second is empty, the third is empty, the name of the limb is fun1.sh, a total of 1
PASS Parameters in Shell: [reprint]. PASS Parameters in shell.PASS Parameters through Shell
When executing a Shell script, we can pass parameters to the script. The parameters obtained in the script are in the following format:$ N.NRepresents a
It's fun to print the terminal in shell! First, we know that echo is commonly used in the terminal printing echoprintf in shell. note: the font color is reset to 0, black = 30, red = 31, Green = 32, * ** = 33, blue = 34, Magenta = 35, Cyan = 36,
There are many things worth learning about shell programming. Here we mainly introduce the quotation marks in shell programming, including introduction to shell programming. In shell programming, there are three types of quotation marks: single
67. Shell Script Introduction, shell script structure and execution, date command usage, variables in shell scriptFirst, Shell script introductionThe shell is a scripting language aming_linux blog.lishiming.netYou can use logical judgments, loops,
Return values of functions in Shell#! /Bin/shSum (){Echo $($1 + $2 ))Return $($1-$2 ))}Sum $1 $2C =$ (sum $1 $2)Echo $?Echo $ cRun the command:./bashTest 11 1.The running result is:12 -- result of sum $1 $210 -- echo $? Because the return value is 10
About the return values of functions in Shell, shell return values#! /Bin/shSum (){Echo $($1 + $2 ))Return $($1-$2 ))}Sum $1 $2C =$ (sum $1 $2)Echo $?Echo $ cRun the command:./bashTest 11 1.The running result is:12 -- result of sum $1 $210 -- echo $?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.