Back up your Web program#!/bin/bash/bin/tar czf/mnt/backup_website/web_$ (date +%y%m%d_%h%m%s). Gz. tar /mnt/wwwroot/web/mnt/backup_websitefind . -mtime +1"*20[1-9][3-9]*"xargsrm - 0Backing Up the
Logical judgments in shell scriptsIf logic is judged. The basic syntax for if judgment in the shell is:1) without ElseIf judgment statement; then COMMANDFIFor example:[email protected] sbin]# cat if1.sh#! /bin/bashread-p "Please input your score:
(character) Expandeach time you enter a command, and then pressEnterkey, inBashbefore you execute your command,Bashwill be on the inputThe character completes several steps of processing. We already know two or three cases, how a simple sequence of
#1, print the usage of the mounted directory, the default is separated by a spacedf-ph | awk ' {print $5,$6} '#2, separated by a space, colon, \ t, semicolonAwk-f ' [: \ t;] ' ' {print '} '#3, Print lines 3rd through 5th in the 6.txt file, nr
#!/bin/bashfile= "/etc/passwd" for row with $ (head-n $file) do echo "$row"; $row is the data for each row in the file ifs=:for value in $rowdo echo "------$value"; $value is passed through in each line: The content done;done after the split;Reads
For syntax formatfor Var in list;doCommandsDoneWhere list can contain:1) write directlyFor Alpha in a B C d;do echo $alphadone2) variablesList= "A b c D" for Alpha in $list;d o echo $alphadoneThe variable is replaced when the shell executes,
1, the first line must be #! /bin/bash#! indicates that the script uses the following interpreter to interpret the execution2. Echo Print outputFor example echo "Hello World" > Aa.txt 3. Receiving parameters#!/bin/bashName=$1Age=$2Sex=$3echo "Name:
1. BackgroundThe Linux shell is a basic skill, because the weird syntax, combined with poor readability, is often replaced by scripts such as Python.Since it is the basic skills, it needs to be mastered. After all, the process of learning shell
The C language implementation of the LS command under Linux (supports-R-parameters):#include #include #include #include #include #include #include void Do_ls (char *), void Do_stat (char *,char *); void Show_ File_info (char *,struct stat
1 Basic composition of shell statementsThe shell is separated by a space between each basic constituent element.For example, [-E file],[,-E, file,] these four basic elements are separated by a space.Same reason [!-e file],[,! ,-E, file,] each of
In short, this technique corresponds to a scenario such as the followingAssume that there is text such as the followingccccaaaabbbbddddbbbbccccaaaaIt needs to be re-processed now. This is very easy,sort-u, but suppose I want to keep the text in its
The shell itself is a program written in C, which is a bridge for users to use Linux. The shell is both a command language and a programming language. As a command language, it interprets and executes user-entered commands interactively, and as a
Automated maintenance of the system with shell scripts is simple, convenient and portable.But shell scripts are read-write and are likely to leak sensitive information, such as usernames, passwords, paths, IP, and so on.Similarly, sensitive
#!/bin/bashecho "Hello world!"1. As an executable programSave the above code as test.sh and CD to the appropriate directory:chmod u+./test. #使脚本具有执行权限 ./test. #执行脚本2. As an interpreter parameterThis works by running the interpreter directly, whose
sed means Stream editor used as a filter in shell scripts and makefile is very common Sed not only supports the normal form. It has some other powerful features.Let me give you a sample to see if there is any way to solve it.hello
Previous JMeter Bean shell Use (a) a brief introduction of the bean shell in the next jmeter, this article is a supplement to the above, mainly summarizes the common scenarios and methods, I believe these basic can cover most of the needs. This
in general, there are three parts, each of which are: character class , quantifier, position qualifier. Specifies that some special syntax denotes character class, numberVolume qualifiers and positional relationships, and then use these special
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.