Parameter related knowledge${parameter:-word}: If parameter is empty or undefined, the variable is expanded to "word"; otherwise, the value of parameter is expanded; ${parameter:+word}: If parameter is empty or undefined, do nothing; otherwise,
#!/bin/bashEcho ' $ "gets the currently executing shell script file name: '" $ "Echo ' $n gets the nth parameter value of the currently executing shell script, n=1..9 ' $ ' =$1, ' $ $ ' =$2, ' $ $ ' =$3Echo ' $get all parameters for the current
The shell is the user interface of the Linux operating system, and we often need to write scripts to allow the operating system to automate the requirements of a series of instructions, this article will briefly describe the language features
8.10 Shell Special Symbol Cut command\ de-Semantic charactersSeveral commands related to pipe breaksUsage of the cut-d commandUsage of the CUT-C commandSort is often used in conjunction with UniqSort is sorted, starting with special symbols, to
8.6 Pipe break and job control pipe symbol "|"
The effect of a pipe character is to drop the result preceding the symbol to the command following the symbol. Not all commands are available after the pipe character, and generally commands
Presumably everyone knows "if ... So ... " The application of this grammar!Of course, Linux for this kind of usage is also considered, many times we need to write a shell script, it is unavoidable to avoid the IF statement.For example: Determine if
Programming is the process of writing program source code using human natural language or machine language. This is what we all know, because it, after all, has programmed what student performance management system, library management system. Wait a
Pipe characterIt is used for the output of the previous instruction as input to the latter instruction.650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/16/1d984a59004a96e2f826e971888f9636.png "title=" Clipboard.png "alt="
Shell Special Symbols
* Any of any characters
? Any one character
# comment Characters
\ de-Semantic characters
| Pipe character
$ variable prefix,!$ combination, regular inside means end of line
; Multiple commands
The problem is that environment variables are not accurately(1) Check that the maven you set in Jenkins is accurate, and you can see if there is a MAVEN option in the new job with the "New Job" button, not exactly what you configuredIf you download
There is often a sentence at the beginning of a shell script to define what kind of SH interpreter to use to interpret the script.There are two main types of shell scripts that are currently developed for testing:(1) #!/bin/sh(2) #!/bin/bashWhat is
Loop syntax in the shellYun ZhengjieCopyright Notice: Original works, declined reprint! Otherwise, the legal liability will be investigated.A. For Loop1. Syntax format 11 for inch Value 1 value 2 value 3 ... 2 Do 3 Source Code 4 Done 2. Syntax
to supplement the switch between Linux users :Su is switching between users, either from a normal user to the root user or from the root user to a normal user. If you are currently the root user, switch to normal user test to use the following
1. FindFind Pathname-options [-print-exec-ok]Let's take a look at the parameters of the command:Pathname the directory path found by the Find command. For example, use. To represent the current directory, and/to represent the system root
Why do I need expect?Through the shell we can achieve simple control flow functions, such as: cycle, judgment and so on. But for situations that require interaction, it is necessary to intervene manually, and sometimes we may need to implement
1, write script/root/bin/createuser.sh, to achieve the following functions: Use a user name as a parameter, if the user specified parameter exists, it will show its existence, otherwise add, and generate a 8-bit random password and there is a file,
Requirements: List which commands are most used and enter them into Chy1.txtIdea: Our command is all there is a history file/root/.bash_history This file, you need to sort the commands used
In the Linux platform simulation of the Linux shell environment, can be implemented by a software: Cygwin (click to enter the official website to download), such as (select the corresponding version to download): Installation:1. Double-click the
Description of function definition formats, function parameters, and Shell functions
You can use shell to define a function, and then use it in a shell script. The Function Definition Format in shell is as follows:
[ function ] funname [()]{
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.