Shell Basics
Shell's Makeis the command that interprets the user, the user enters a command, and the shell interprets the execution of a rule, which is called Interactive (Interactive),The shell also has a way of executing a command called
The basis of a simple progress bar1. ArraysBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. Similar to the C language, the subscript of an array element is numbered starting
GrepIn the past, we used grep to find lines in a file that contained certain strings, such as finding a string in a header file that fits a pattern (pattern), such as finding all strings that conform to the [email protected] pattern (that is, the
VariableDefining variablesYour_name= "Runoob.com" #变量名和等号之间不能有空格Using variablesYour_name= "QINJX"Echo $your _nameEcho ${your_name}echo "I am good at ${skill}script"echo "I am good at ${skillscript}"Curly braces are added to help the interpreter
Awk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using spaces as the default
Set Environment variables:①export variable name = variable Value #设置环境变量② variable name = variable Value #设置环境变量Export variable NameSet #显示当前shell所有变量Env #查看环境变量unset variable name #删除变量Common environment variables:Path variable: Paths to System
The basic meaning of shell variable $#,[email protected],$0,$1,$2 in Linux:Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a
${varname:-word}If varname exists and is not nil, returns the value of VarName, otherwise returns word. This is commonly used to return a default value when VarName is undefined${varname:=word}If varname exists and is not nil, return the value of
First preprocess the number of layers and rows, then three answers, pay attention to the details#include #defineINF 0x3f3f3f3fConst intmaxn=2000100; typedef __int64 LL;using namespacestd;inti; LL N,s,ans1,ans2,ans3; LL SUM[MAXN+Ten]; LL
Last Friday operations there was a excle for a mobile phone number, asking for information about all users that correspond to user numbers. This time encountered a problem is that you need to query the number of users, not one to check, and excle in
For syntax formatfor Var in list;doCommandsDoneWhere list can contain:1) write directly for in a b c D; do Echo $alpha Done2) variableslist="a b c d" for in $list; do Echo $alpha DoneThe variable is replaced when the shell executes, and
Glob extensionIn the path extension in the shell, there are several glob involved:? Match any single character* Match 0 to more characters[Set] matches any one of the characters in the set, such as [0-9], matches any number[!set] matches any
Reference: http://blog.csdn.net/wanglang3081/article/details/49423105 (1) Makefile is essentially a shell script, that is, each command is a shell process, and the shell process exits when it finishes running. (2) Shell code line, if there is =,
Tag: exec source ForkFork is a system call to Linux that creates a child process that is a copy of the parent process, obtains a certain resource allocation from the parent process, and inherits the environment of the parent process. The only
First, define variablesDefine variable names without a $ (unlike PHP, as with Python), with no spaces between variable names and "=" (special, unlike other languages)Example: x= "Hello World"Note: The naming of variable names should follow the
The shell acts as an interface between the user and the kernel in the Linux system, which is used to convert the commands entered by the user into instructions that the kernel can understand, and then to perform the corresponding functions through
The most common Linux commands and toolsDirectory Next document: CD nameReturn to the previous directory: CD.To view and edit a text file:? View files: More, tail? Edit File: VIsuch as scripting. SHVI shell.shTo view system network status:? View
IntroductionBody$?$? is a shell variable that represents the exit state of the last execution command. 0 for success, not 0 for failure. Remember: $? Always indicates the exit state of the shell command after the last execution, and when the
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