One: Shell introduction1. What is a shellThe Shell's Chinese meaning is "shell," in layman's words, the shell is an interactive programming interface that uses the user input to drive the operating system kernel to complete the specified work. In
The shell is a bridge between command and hardware.The shell works in two ways: interactive, batch dispositionInteractive: A user enters a command at a time, the shell translates and executes aBatch processing: The user makes multiple commands into
Shell programming is in the form of:1: meta-character []. * ?+ ( ) | { } ^ $2: [a-z0-9] Represents a random number and letter match3: [^a-z] matches the random one except the letter4:ab+c + represents a character that matches one or more of the
Alias creating aliasesUnalias Deleting aliasestype [name] to see if it is an internal or external commandenv lists all environment variables and their contents in the current shell environmentset to observe all variables in the current shell
Post Address: http://keep88.blog.51cto.comBo main name: Li ChangmingThis note is from------and the old boy learn Linux OPS "shell programming Combat"Directory:Core basic knowledge and practice of shell variables1. Variable type:Environment variables
The shell script resembles the following:
Bash or dash
The wording of a case statement
Script Help notation
The wording of whether the argument is empty
Parameters
#! /bin/Bash Case " $" inch-h|--help|?) Echo "usage:1
This article is intended to accumulate a solution to small problems that are encountered when writing shell scripts at ordinary times. There are occasional updates here for later review and continuation.One, define the default values in the shell
Demand:Text in the first column of the word typeface, and so on, the second column is added, the final output characters and the final and (for the convenience of final check, gave 1)The text is as follows:Cat test.logabc 1aaa 1bbb 1ddd 1sss 1iii
This is a wonderful command.TR's whole spell is translate, that is, translation. Interestingly, we are able to make rules for translation. Use methods such as the following:TR [option] set1 [Set2]TR accepts input from standard input. The results are
Recently received the manager request to the RHEL7 LVM new partition expansion automation, because uses the virtualization platform, therefore uses to add the new disk the way to do:#!/bin/bash# #在线扫描新磁盘# #Step1: Recognize New hard
1. Purpose(1) Shell knowledge Summary. Good memory is better than bad writing, finishing the relevant shell knowledge and combining their own practical experience to organize, the content will not involve all the knowledge points, will only cover
A wildcard wildcard is a class of keyboard characters. Wildcards are often used in place of one or more real characters when looking for a folder, when you don't know the true character, or if you don't want to type the full name. *
The first is to create the shell daemon: (shouhu.sh)#!/bin/bashtest () { while true do ls ./ >> 123.txt sleep 5 done}case $1 instart) path= "/root/shouhu.pid"
Record the use of arrays in the shellThe main is the creation of elements, elements of the increment, delete, change operation.1#!/bin/Bash2 3 #基本数组操作4A= (1 2 3) # # () denotes an empty array5 Echo "a No. 0 element:"${a[0]}6 Echo "all elements:"${a[@
The head of the Sunset Building, the voice of the hung, Jiangnan wandering. The Wu hook to see, the railing shot all over, no one will, boarding meaning. --Deng Jiankang and Heart PavilionThe hill algorithm is a sort algorithm proposed by Hill
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.