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#!:/

Shell Common Scripts

Shell Common ScriptsAuthor:headsen Chen 2017-10-17 15:36:17Personal original, reproduced please indicate, otherwise, legal liability shall be investigated1,vim name.grep.sh2,cat tellme.sh3,cat idcheck.sh4,cat case.shNote: The file name is called in

Shell's looping nesting syntax

To test the shell's looping nesting syntax1[Email protected] test]#VIXunhuanqiantao.SH 2#!/bin/Bash3 #程序功能描述:4 # test Loop nesting5 #作者: Lone boat Point6#版本:1.07#创建时间: .-Ten- A Geneva: $:

Shell finishing (31) = = = To determine if the input is IP

(title): Determine if the incoming parameter is IPIdea: 192.168.1.1is the condition of the IP, * * * dot decimal This four number must be less than 255Dot decimal must be guaranteed to be a number, not a letter#!/bin/bash[ -z $1 ] && echo  "uesage : 

Shell finishing (37) = = = Variable understanding and two exercises

1/etc/profile2 ~/.bash_profile3 ~/.BASHRC4 $PATHWhere/etc/profile is the global environment variable that takes effect for all users, while. Bash_profile only works on the current user.~/.bash_profile: Each user can use this file to enter shell

Common shell commands

1. Find the contents of the file (e.g. account number: zh123456): Grep;lsMode 1 Find all Files: grep zh123456 *Mode 2 recursive lookup: ls | Xargs grep zh123456Mode 3 Recursive lookup: Find. -name ' apf44_zswmpay* ' |xargs grep applog|awk-f ": '

[Shell programming] automatically deletes operating system users

Linux often need to delete user actions, manual operation to perform Userdel operation can, if the deletion fails according to the error prompt action. But what if the script needs to invoke the Delete user action? Use the following example to

Shell programming Syntax (i)

Steps to create a shell program:First step: Create a script file. Sh.Second step: Grant permissions so that it can execute chmod u+x. shStep three: Execute./example or SH exampleShell structure:1. #! Specifies the shell that executes the script2.

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

[Turn]bash shell common shortcut keys

Tag: will return CTR Word delete Move page ackMove cursor ctrl+b: Move forward one character (backward) ctrl+f: Move back one character (forward) alt+b: Move forward one word alt+f: Move back one word ctrl+a: Move to the

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= ('

[Linux] Shell Scripts

Shell script is a "program" written using the shell's function, which uses plain text files to write some shell syntax and instructions (including external instructions), with regular expressions, pipeline commands, and data flow redirection. In

Shell: Delete/Preserve a specified line in a file

Delete the first line in the file file1 to the line containing word characters and redirect to the file File2:Sed ' 1,/word/d ' file1 > File2Keep the lines in the file file1 that contain word characters and redirect to the file File2,-n to indicate

Nginx Log cutting shell by day

#!/bin/bash############################################## #Author: Liuzhengwei-[email protected] #QQ: 1135960569# Last modified:2017-08-16 16:05#filename:nginx_logrotate.sh#description:######################################### # # # # #back_dir

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

"Linux Series" "Basic Edition" chapter III Shell Basics

The origin of 3. shell basic knowledge     3.1 shell          3.1.1 bourne agin shell        3.1.2  the other shells,   have  zsh, ksh     3.2  see if shell         3.2.1 yum list | grep zsh         3.2.2 ls /root/.bash_history        3.2.3 echo $

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,

Shell Miscellaneous Set

1, Shell Equality comparison note-eq Comparison of numbers equal= = Comparison of string equality2, = = and the difference= = can be used to determine if a variable is equal, = In addition to being used to determine whether a variable is equal, it

Java invoke shell script

There are several places in the recent new project where you need to invoke the shell script, which records a simple shell script invocation method. The code is as follows:private void Callsh () {InputStreamReader STDISR = null;InputStreamReader

Total Pages: 541 1 .... 444 445 446 447 448 .... 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.