There are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}
There are usually 3 ways to perform mathematical operations in the shell:Expr commandFor example, expr 1 + 6 will return 7, the disadvantage of using expr is to encounter multiplication, or parentheses (because they have other meanings in the shell),
Scripting features: For analyzing and summarizing a large number of ping log files------------------#!/bin/bash# check ping result# by colin# on 2016-06-08#################### ##################### function Description: This script is used to
Description of UseThe dirname command can take the directory portion of a given path (strip non-directory suffix from file name). This command is rarely used directly from the shell command line, and I typically use it in a shell script to get the
One, Shell scriptPre-placed in a file with a variety of commands to facilitate one-time execution of a program text; some shell syntax and instructions are written inside, and then the functions such as formal notation, pipeline commands, and data
The difference between the anti-quote and $ ():Let's first look at an example:Create a file named Test.sh, enter the following two instructions in the file650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/DB/wKioL1ditWDAq5FZAAAJ9atF8Qc539
Shell scripts or function-passed arguments, you can access positional variables to use the values of the parameters. However, in the case of complex parameters, it is best to use getopts processing, which handles the command line options and
use these commands to do almost anything you want to do.
Command
Describe
Alias
Define an alias for the specified command
Bg
Run of later mode recovery jobs
Bind
Bind a
#break和continue命令: During a loop, sometimes you need to force the loop to break out when the loop end condition is not reached#break: Allow all loops to jump out (end all loops after execution)1 while: #死循环写法 #2 Do3 Echo-N"Input A number
I. Understanding rights and User management1. View PermissionsPermission Type:1, R read 2, W write 3, x executableLinux Users1. Owner (U) 2, owning Group (g) (All users of owner and owner Group) 3, other User (O) (all users of other groups
Usage of the Linux Cut commandFont: [Increase decrease] Type: Reprint time: 2013-10-03 I want to commentCut is a selection command that analyzes a piece of data and takes out what we want. In general, the selection of information is usually for
Some time ago in the study shell script, the last mention of the SED mode space and maintain the concept of space, but has not studied well, these two days studied, so it sent, not very comprehensive, just for your reference.Keep the space sed under
I. Digital testingFormat: N1-op n2Test Operation op:EQ/NE/LE/GE/LT/GT--equals/not equals/less than equals/greater than/less than/greater than1. A numeric comparison can use a special (()) operator, which is closer to the C language, see digital
When using "&&", only Command1 execution succeeds, Command2 will execute, otherwise command2 not execute; [[email protected] ~]# ls 1.txt && ls 2. Txt1.txt2.txt[[email protected] ~]# ls 1.txt && ls 20.txt1.txtls: Inaccessible 20.txt: No file or
This article describes the most common tools for using the shell to process text under Linux:Find, grep, Xargs, Sort, uniq, tr, cut, paste, WC, sed, awk;The examples and parameters provided are the most commonly used and most practical.I use the
Small black daily tossing-quick creation of shell scripts for private CA
Tom started to make new things again. He just learned how to build a private CA through openssl last week and spent some time writing this script on Saturday. After that, he
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service