Reference documents:There are eight ways to intercept a string, mainly for the following methods650) this.width=650; "alt=" Copy Code "src=" Http://common.cnblogs.com/images/copycode.gif "/>There are a number of ways to intercept strings in the
The result returned by the conditional expression is BooleanIt's 1, false is 0.Expressions for conditional tests[Expression][[Expression]]Test expressionCommonly used for:Monocular:-e file Test files exist-F file Test is a normal file-D File Test
package.sh #!/bin/bashfor i in ' cat $ ' do echo $i >> resultdpkg-l | grep $i | Sed-n 1p > Tmp//awk read out all the data after the fifth column awk ' {for (i=5;i> result//the error content of the script Directed to a file in sudo dpkg--purge $i >>
I am not clever and understanding something are not quick. Even so,i can ' t be scared for facing it. Practice more and practice more. Don ' t stop your passion.
Recently to work on GitHub with small partners to do projects, my github ....
In Qt, you often invoke external commands or execute shell scripts, and you want to analyze the execution results.Qprocess runshellprocess =new qprocess (this); // Monitoring of invoking process outputs This , SLOT (Readprocess ())); Connect (
1. grep====================== from Shell script Raiders =================================
Search from file or standard input.
-E (E) (equivalent to egrep ) + "Regular expression" + files
- o (Output matching text only, can be used
Http://blog.sina.com.cn/s/blog_a56ef5490101cn58.htmlSed is a good file processing tool, itself is a pipe command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work, the
1. Integer comparison
-eq equals, such as:if [ "$a"-eq " $b"]
-ne not equal to, such as:if [ "$a"-ne " $b"]
-GT greater than, such as:if [ "$a"-gt " $b"]
-ge greater than equals, such as:if [ "$a"-ge " $b"]
-lt less than, such as:
-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if filename is writable,
The essence of the shell is to convey a series of commands or signals to the system, usually in the form of a command plus a large string of characters. This string of characters is the character used to express meaning, which is the regular
[email protected] ceshi]# cat test.sh#!/bin/bash# test.shecho "-------------ISF is set to \"-seperator\ "------------"Ifs= "-seperator"; # Note that there is a minus sign (-) before SeperatorFor i in "[email protected]"; Do echo "@ ' $i '"; DoneFor
Several key words in the Shell control loop break continue exit#!/bin/bash#在1-loop in the 10 sequence, if the sequence equals 5, the number is not displayed and the loop is interrupted to continue with the successor task.For i in ' SEQ 1 10 'DoIf
20,150,722 Week Three1. Generate a log file daily according to the format xxxx-xx-xx, for example, the file generated today is 2013-09-23.log, and the disk usage is written to the file.#vi/usr/local/sbin/crontest1.sh#!bin/bashd= ' date +%f '
The shell also uses break and continue to jump out of the loop.Break commandIn the following example, the script enters a dead loop until the user enters a number greater than 5, using break to jump out of the loop.#!/bin/Bash while : Do
1. Variable Reading example: Echo $PATH echo $ (PATH)2, Variable assignment: AA=ASDF Note: There is no space around the equals sign3. View all environment variables: env4. Id:echo $$ of the current thread5. Custom variable to environment variable:
After the first two articles, so far, we have acquired the external domain name and set up the SVN server, next, we will summarize how to implement access to the local area network.1. Install VISIUALSVN Server (visible: http://blog.csdn.net/lu930124/
In Linux, the shell variable $ #, $ @, $0, $1, $2 has the following meanings :,
Variable description:
$ PID (ProcessID) of Shell itself $! PID of the background Process last run by Shell $? End code of the last command (Return Value) $-Flag list
Shell script to delete the folder N days ago ----- the difference between the date command on linux and mac
Background:Every day you build things and put them in different folders by date. For example, today's construction is put in, tomorrow's will
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