The Shell's own abilities.Writing scripts is OK, at least now I'm running a script on the InternetProgram-Log scheduled backup and delete, NFS Shanghai volume file Delete and send mail."Data"Export
See other people's study summary, feel good turn over (transfer from tryfly)First, Shell Script FoundationThe shell script is a program written using the shell's function, which uses a plain text file, writes some shell syntax and instructions
Logical symbols1. about the file and directory of the detection of Logical volume label!- F Common! Detect if "Archive" exists eg:if [-f filename]- D common! Detects if the directory exists- B detection is a "block file"- C detection is a
Programming languages: Machine language, assembly language, advanced languagesStatic language: Compiler language, features: strongly typed ( variables must be declared before they are used, or even initialized ), and converted to executables.
calculate the front of a specific directory Ten a large fileIn a given directory, want to know which large files exist, take the top 10, by file size ranking(1) , using awk to achieve#!/bin/bashPath=/root/shellFind $path-type F | awk ' {Var=$0"Ls-l"
This blog is referenced from:Http://www.cnblogs.com/waitig/p/5523409.html"Shell from Beginner to mastery" Zhang ChunxiaoShell IntroductionThe shell itself is a program written in C, a user to use UNIX or Linux bridge, most of the user's work needs
Print rows in reverse orderUse awk or TAC can be done. TAC The name of this command is actually written in reverse. Cat . (1) , using TACThe syntax for this command is as follows:Tac File1file2 ...It can also be used from stdin Read in:$ seq 5 |tac54
1. Conditional selection: If statement① Single Branchif judgment condition; then condition is true Branch code FI② Dual Branchif judgment condition; Then condition for true Branch code else condition for false Branch code FI③ Multi-Branchif judgment
1:t= "ASDASD sdasd"Defined variables typically have strings and numbers ${t} and $t use variables2:o= "Sdfjkflsjl SDKAFJLJKDASL ${t}"echo o print variable echo $o $t link variableBasic operation can refer to the hand, as the script is easy to
#1, replaceReplace 2017 in #将1. txt file with 2016 display on screenSed "s/2017/2016/g" 1.txtReplace 2017 in #将1. txt file with 2016 display to completely modify the file on the screen, plus I modify the fileSed-i "S/2017/2016/g" 1.txt#Sed读取系统变量,
Original link: http://www.361way.com/shell-eval-variable/4957.htmlNesting of variables is often used in the shell. For example, the value of a single or multiple variables as a variable name, and then the variable name to get its internal variables,
The idea is to learn the code creation is their own very like the first few lines of logic rigorous#!/bin/bash#判断两个整数的大小Read-p "Please enter two integers a B:" A B#或者使用a =$1[-Z "$a"]| | [-Z "$b"]&&{echo "The number you entered is zero"Exit
I. What is a script (scripts)A command file that installs a logical relationship record, in which the file name can be used to initiate the execution of a command within a script, and the shell script is an explanatory language that requires an
In the morning test script, accidentally in this article "git–setting up a remote repository and doing a initial push" see a fun thing about Git, recorded here.Add the following in the ~/.BASHRC, as prompted by the article, to let the prompt display
1. Regular expressions
^
Line Start flag
$
End of line Mark
.
Match any one character
[ ]
Match any one of the characterscontained in [ character ] ,Coo[kl] matches Cook or
First, what is the bean Shell
BeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods.
BeanShell is a loosely typed scripting language (this is similar to JS);
1. Questions on the face of the awk command(1) Recently logged in 5 accountsLast-n 5 | Awk-f ': ' (specify domain split symbol) ' {print $} '-N indicates number and how many rows need to be displayed. Reads a record with a ' \ n ' newline, then
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.