Shell-neutral expression primitive characters

^ matches only the beginning of the line$ matches end of line only* A single character immediately after the *, matching 0 or more of this single characters, it can also be a sequence. You can use-to represent a range of character sequences within []

5th day (half day) "Shell programming preliminary, grep and regular Expressions"

Day 5th (half day) "Shell programming preliminary, grep and regular expression" shell programming preliminary (_RECV)Shell script: Text file#!:/ Bin/bash#!:/ Usr/bin/python#!:/ Usr/bin/perlCase Listing 1:Vim first.sh#!:/

The shell implements statistical views and saves the results to a file

Log files are one per day. A keyword in the statistics log file that gets the number of views per day. Save the number of times to the TXT file.Save the date in the TXT file as well.Enter a start date and an end date to count the number of times per

Shell---Data flow redirection

Data Flow redirection: is a command that should appear on the screen after the data transfer to other places.Standard input (stdin): code 0, using Standard output (STDOUT): Code 1, using > or >>;Standard error Output (STDERR): Code 2, using 2> or 2>>

Shell Script First Learning

The first shell program runs, tutorial from: http://jingyan.baidu.com/article/8cdccae947f83e315413cd05.htmlThe code is as follows:1 #!/bin/sh2touch a.txt3sleep4 echo"testtesttesttest">>a.txtI don't know why. Tip: MSYS2 terminal has stopped working.

Shell parsing my.cnf configuration file

MY.CNF configuration format is as followsVI my.cnf[Client]port=3306Socket=/tmp/mysql.socket[Mysqld]port=3306Server-id=1Datadir=/usr/local/mysql/data[Mysqld_safe]port=3306More parsemy.sh#!/bin/bashcnf=$ (CD ' DirName;p wd) "/MY.CNF"#得到区块数组g_sec= ('

Shell exercises 21 files show content three lines as one line

Requirement: One file displays the content three line as a lineIdea: is the second line of content, the contents of the third row is appended to the first row, so that the contents of three lines can become a row, if not enough three lines

How the shell script modifies lines in the text before matching rows

Original documents, welcome to read, Forbidden reprint.In the example, the "yes" in the previous line of the finish is changed to "yes"One way to do this is to use Sed+awk together.[Email protected]:~$CatA.txtline0is yesline1is yesline2is yesline3is

Shell Script Management Disk

Scripting features: Display all disks and select, partition all selected disks, repartition partitions and format file system#!/bin/bash# Display all disks and select, format partition of selected disk, repartition partition and format file

The Shell Three Musketeers find

To find files that end in INI[[email protected] app]# Find/-name "*.ini"/app/myblog/config.iniEXEC explained:The-exec parameter is followed by command, which terminates with '; ' To end the sign, so the semicolon behind this command is indispensable,

Several methods of implementing Linux shell calls under QT

Using Qprocess Qthread============================================#include int main (){Qprocess::execute ("LS");return 0;}============================================ Qprocess *poc = new Qprocess;poc-> Start ("Ping 222.207

The difference between $* and $@ in the shell

$* all positional parameters, being used as a wordNote: "$*" must be referenced by ""[email protected] is synonymous with $*, but each parameter is a separate "" reference string, which means that the parameters are passed completely, are not

Some uses of shell grep

#1, total number of statistical characters#统计系统中不允许登录的用户数Grep-c ' Nologin '/etc/passwd#2, case-insensitive lookup of all lines of the specified character;Grep-i ' Good ' 9.txt#3, print the line and line number of the specified character;Grep-n "Good"

Shell instance Practice + detailed

Thinking of comparing the shell to a script like Python and Java, I gave up when I had the idea. This is too insulting to the shell. (Crying smiley!) )As a programmer, Linux is the most basic requirement. and the shell script will sometimes show its

Shell Block comments

Used to write scripts often worried about the big paragraph of the text to My line with "#" to comment, I think the shell is not as smart as C, there are two different ways to annotate. Today I know that I am not smart, I do not see the use of

Shell base syntax and monitoring process does not have a restart

transcoding# Dos2unix./test.shPermissions#chmod a+x./test.shGrammarVariableVar= "111"Echo $varEcho ${var}Operationno1=4;no2=5;Let Result=no1+no2echo $result;Self-increment self-reductionLet no++Let no--[] and let similarresult=$[No1 +

Shell scripts add users in bulk

Add the appropriate user account to the Linux service and the initial password is "123456". You can specify a list file for all users, and then write a script named uadduser.sh.[[email protected] ~]# vim/root/users.txt //Create a new list file that

Shell sort and two-fork tree sort

Shell sort#include using namespacestd;voidPrint (int*list,intlen);voidShellsort (int*list,int*list2,intLenintgap);voidShellsort (int*list,int*list2,intLenintGap) {intCC = Len/gap + (len%gap! =0);intL =0; for(inti =0; I ) { for(intc =0; C ) {

Java Shell Sort

The code is as follows:public class Shellsort {public static void Sellsort (Datawrap [] data) {System.out.println ("start sort:"); int length = Data.lengt The h;//h variable holds the variable increment int h = 1;//The maximum value of the increment

Use X-shell on win10 to connect to Ubuntu in a virtual machine

1. In Ubuntu, install SSH:sudo apt-get update # to complete system updatescd/etc/init.d/# See if SSH service is installedsudo apt-get install Openssh-server # for installationsudo etc/init.d/ssh Restart # Restart service, others are:

Total Pages: 541 1 .... 516 517 518 519 520 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.