Shell Script Learning Summary----sed+grep+awk+ Regular================================================================================First part SED================================================================================I. INTRODUCTION of
The bash and shell relationships of LinuxShell Popular Understanding: Translate user-entered commands to the operating system.The shell is an interactive command interpreter. The shell is independent of the operating system, which gives the user the
Because the shell script is used in the project, the system looks at it a bit. Previously, it was a general understanding. Variables: Environment variables, pre-defined variables, positional variables, custom variables. Environment Variables This
Recently in the design of a Linux system scenario, write a configuration and log management of the upgrade service program.A total of 4 files, Server a updateserver.conf configuration file and a updateserver script, a updateclinet.conf configuration
Interactive commands: Variable content is determined by the userRead [-PT] Variable-P: Can be followed by a prompt-T: The number of seconds to wait afterecho [-ne] Stringecho [--help] [--version]-N: Do not wrap in the last line-E: If the following
1. Monitoring commands (run once every 2 seconds)watch "ls -larth"2. Kill the program with one portsudo fuser -k 8000/tcp3. Limit the memory usage of the following commandsulimit -Sv 1000 # 1000 KBs = 1 MBulimit -Sv unlimited # Remove limit4.
Https://www.shellscript.sh/variables1.htmlA variable is the name of a block of memory that can be manipulated (read, write).1, return to the tradition. -"The only way to learn a new programming language is to use it to program"try -1Create a
(a) write the series as shown below[Email protected] ding1]# bash 5.sh2/13/25/38/513/821/1334/2155/3489/55144/89233/144The shell code is as follows:#!/bin/bash>aa>bbEcho 1 2 | Xargs-n1 >AAFor i in ' seq 20 'DoA= ' Cat AA | Sed-n ' $i ' P 'b= ' Cat
"Must be finished this time" series? Section--linux SHELL script Raiders. (Manual cover face ...) )1, the simple start. -"The only way to learn a new programming language is to use it to program"Don't think too much, just tap the code:[Email
CCat Zdd Browse the contents of a ZDD fileCat Zdd1 Zdd2 Browsing the contents of multiple filesCat-n ZDD Browse the contents of a file Zdd and display line numbersCD back to the start directory, that is, just logged into the system directory, CD
Touch commandThe touch command is used to create empty files, such as when an application wants a log file to exist before they can write to the data. You can create an empty file with the touch command: touch test1 ;The touch command can also be
1.if statements(1) If statement of two-way branch(2) If statement of the multi-path conditional Judgment Branch2. Test statements(1) file test(2) String test(3) Numerical test(4) Test statements combined with logical operators3.case statements4.for
First paste one, join--helpusage:join [OPTION] ... FILE1 File2for Each pair of the input lines with the identical join fields, write a line tostandard output. thedefault join field is the first, delimitedby whitespace. When FILE1 or FILE2 (not
You can use the script to pass parameters to implement the substitution#-*-coding:utf-8-*-#Author:sunhaoImportSYSF= Open ('Yesterday','R', encoding='Utf-8') F_new= Open ('Yesterday.bak','W', encoding='Utf-8') Find_str=sys.argv[1]replace_str=sys.argv[
The shell function is similar to a shell script, which holds a series of instructions, but the Shell function is in memory, not the hard disk file, so it is fast, and the shell can preprocess the function, so the function starts faster than the
#!/bin/bash# Simple script for two number operations A+ -, altogether three parametersEcho$# #对获取的参数以此判断是否包含 [a-za-Z] Something, if included, to exit. Because numbers add up, not numbers, or subtraction. forI_argsinch "[email protected]" Do
DescriptionThis is a note about http://c.biancheng.net/cpp/shell/.Shell StringStrings can be in single or double quotes, or without quotation marks.1 #!/bin/bash 2 3 # #字符串 4 5 #不加引号: 6 #无法出现; 7 echo a 8 echo a;b 9 #单引号: One #单引号里的任何字符都会原样输出,
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