Linux Shell script Programming--cut command

CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of

Shell script, logical structure problem exercises.

awk '/5/{a=1}!a ' file2Results:1234Explain:The first line/5/does not match skip {a=1}, continue to!a, at which point a no value belongs to the false take reverse to true, so the first line of outputThe second line/5/does not match skip {a=1},

The basic knowledge of the 13th chapter before you learn shell scripts

1. Set the environment variable histsize so that it can save 10,000 command history.   vim/etc/profile   change histsize=1000 to histsize=10000 2. Why do I set PS1 (ps1= "[\[email protected]\h \w]\$")    display the results to be different from

Shell instance: Temporarily solve the problem of automatic disconnection of rsync

Requirements: The company has two backup servers, one from the beginning, every night from the server began to synchronize some data on the main service, but rsync always disconnected, tried a lot of methods are useless, wrote a script to solve this

How the shell reads each line of the file

1. Read a row of data using the Read commandWhile read Mylinedo echo "line:" $mylinedone 2. Read a row of data using the Read commandCat Datafile.txt | While read Mylinedo echo "line:" $mylinedone3. #读取一行数据Cat Datafile.txt | While myline=$ (line)

Condition testing and judgment in the shell

Condition test:To determine whether a demand is satisfied, it needs to be realized by testing mechanism;How to write a test expression to implement the required tests:(1) Execute the command, and use the command status return value to judge;$?:

Installing the virtual machine shell script

Installing the virtual machine shell script650) this.width=650; "title=" screenshot from 2016-10-19 13_18_47.png "style=" Float:none; "src=" http://s4.51cto.com/

Awk's shell quickly modifies file names

Scenario: Fake tune There are several files like this in your directory1.jpg?v=12.jpg?v=23.jpg?v=34.jpg?v=4What if the v=x of the file is removed?Method One: Direct write command implementation using AWK shell command implementationls | awk ' {split

Shell while loop

The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is:While Commanddo Statement (s) to being executed if command is TruedoneThe command

Parameter references in the shell

Reference parameters Describe 0,1,2. Positional parameters. Start with the parameter 0. The parameter 0 references the name of the Startup bash program, and if the function runs in the shell script, the name of the shell

First shell script

Open a text editor, create a new file, the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name is good, if you write a shell script in PHP, the extension is good with PHP.Enter some code:

Shell command _for

chmod 755 demo.sh./demo.sh 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 6667686970 #!/bin/bash# Author:James 2016-10-15# 集合以空格分割fori in 1 2 3 4 5 6    do   

Shell Common file Property check

The common check parameters are as follows:Operator            If ... True-b file         file is a block device file-c file          file is a character device file-d file           file for directory  -e file          file exists-F

Eval under the shell in POSIX

In a POSIX shell environment, eval is used to remove a string when the parameter option is used, and the effect is the same as "'", which is useful when writing large numbers of references to more complex scripts. The simple use of bash, usually

Shell Note 5

Filter GawkGawk is a language that can perform pattern scanning and data processing. Gawk searches for one or more files, finds records (usually rows) that match the pattern, and processes the records by performing the specified actions. Gawk

Linux Shell Programming II

With "'"""todayis" ' date ' preceded by a character, followed by ' date ' Represents the Execute Date command. PDATE=""'date'is Date" Expr " is used to calculate the result of a=9b=tenvar1= $a +$becho $var 1 output is "9 +10"expr" is used

Shell Study Note

5.1 Printenv View Global variables Bash New shell Set Global variables and localvariables Export Test Local→global, so it can be

Shell Note 2

Shell types: Bourne shell, Bourne Again shell, C shell, Korn shell, Perl shell Users can choose their favorite shell (specified when the system administrator creates an account for the user), and in the last field of the/etc/passwd file, you can

Linux Shell Learning Note 00

1. Bash = Bourne Again SHell2. Terminal prompt:#普通用户 [email protected]$ #管理员用户 [email protected]#3. The shell script is usually a text file that starts with Shebang:#! /bin/bashShebang is a line of text where #! is before the interpreter path.

Enterprise Shell interview questions: Get 51CTO Blog list sorted in reverse chronological order

Enterprise Shell interview questions: Get 51CTO Blog list Reverse sort exam questionsOld boys education and training institutions demand: the need to enter:Please put all the posts in the http://oldboy.blog.51cto.com address according to the

Total Pages: 541 1 .... 419 420 421 422 423 .... 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.