Startup script start.sh This script is used to start the project, log logs and PID#!/bin/shprg=" $" #$ A represents the current startup script # Get the true path of the file while[-H"$PRG"]; Dols= ' Ls-ld"$PRG"' link= ' Expr"$ls": ' .*-> \ (. *\) $"
First, function definitionThe Linux shell can be user-defined functions and can be called casually in shell scripts.The functions in the shell are defined in the following format:function ] Funname [()]{ action; int ;]}Description
1,
English original link: https://www.lopezferrando.com/30-interesting-shell-commands/1. Monitoring commands (run every 2 seconds)"ls -larth"2. Kill the program with one portsudo fuser -k 8000/tcp3. Limit the memory usage of the following
[From]Https://www.zmrbk.com/post-2030.html40952771My understanding is that if the problem described in title occurs, it is because of the combined effect of using different shell programs and corresponding stty to set the corresponding
8.6 Pipe symbol and job control8.7/8.8 Shell variables8.9 environment variable configuration file
8.6 Pipe symbol and job control
1. Pipe Symbol | Pass the result of the preceding command to the following commandFor example, # cat
8.10 Shell Special Symbol Cut command8.11 Sort_wc_uniq Command8.12 tee_tr_split Command8.13 Shell Special Symbol
Shell Special Symbols
* represents all characters for wildcards
? is a single character
is the
[TOC]Shell programming One, Shell script introduction
The shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language.The shell is a scripting language;Can use
1. TopicsThere are log 1.log, part of the following:112.111.12.248 - [25/Sep/2013:16:08:31 +0800]formula-x.haotui.com "/seccode.php?update=0.5593110133088248" 200"http://formula-x.haotui.com/registerbbs.php" "Mozilla/4.0 (compatible; MSIE 6.0;
There are two ways to send a shell script:Way 1:sh file.sh arg1 Arg 2 ....Mode 2:read-p "hint" Arg 1 arg2The default parameters are directly separated by a space, following a few examples to explain the problems encountered in the communication and
While and for are circular statements, relative, the For loop uses a bit more. But the while loop is especially useful when reading a file line.While formatwhile [ 条件 ]do 内容done
Example: Determine if I is small and equal to 5, if less than
Ctrl + d 删除一个字符,相当于通常的Delete键(命令行若无所有字符,则相当于exit;处理多行标准输入时也表示eof)Ctrl + h 退格删除一个字符,相当于通常的Backspace键Ctrl + u 删除光标之前到行首的字符Ctrl + k 删除光标之前到行尾的字符Ctrl + c 取消当前行输入的命令,相当于Ctrl + BreakCtrl + a 光标移动到行首(Ahead of line),
+ Plus-Minus* Multiply/except* * Sub-party% take-upThese operational symbols need to be escaped in some scenarios. For example, in a wildcard scenarioThe operation must be two brackets or a bracketLet operation does not display the result and
If one, if base 1, single branch 1.1 syntaxif语句语法 单分支结构语法: if [条件]; then 指令 fi 或 if [条件] then 指令 fi1.2 Examples[[email protected] day4]# cat if-single1.sh #!/bin/sh#功能:单分支if结构整数比较,用-lt格式例子#created by
First, new peanut Shell 1.0On the Peanut Shell official website (http://www.oray.com) Download "New Peanut Shell 1.0" installation software, software installation completed, need to register, after the successful registration of Peanut Shell website
Array Declaration ArrayDeclare-a Array_NameDeclare-a array_name: Associative arrayNote: The two cannot be converted to each otherArray name and subscript (index)Index: Numbering starting from 0, which is a numeric indexNote: Indexes can support the
20.16/20.17 functions in the shellImplicit functions for displaying variablesResults of executionparameter is only one 1, the result of the first is 1, the second is empty, the third is empty, the name of the limb is fun1.sh, a total of 1
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