Shell metacharacters and shell internal variables
Shell metacharacters > Prog> file redirects the standard output to the file> Prog> file: attaches the standard output to the file.| P1 | P2 uses the P1 standard output as the P2 standard
Http://tech.foolpig.com/2008/07/09/linux-shell-char/
Shell string truncation problem:1. Linux Shell intercepts the first eight characters of the character variable by using the following methods:1. expr substr "$ A" 1 82. Echo $ A | awk '{print
Although he does not know who Lu Jun is, his book is indeed easy to understand and has the meaning of training materials..
Linux Shell programming started from UNIX and was presented as a human-computer interaction tool in the early days. After
How to run a script
Three methods:
Absolute path:/tmp/shell. Sh
Relative Path:./shell. Sh
Variable path: Put the directory where the script file is located in path, and then shell. Sh
Below is a simple script
And learn anyProgramming
8 hours reference
Terms
Reference: The selected text is enclosed by some type of reference tag, so that the selected text becomes a text character.
Escape: escape a character means that a backslash (/) is added before the character to escape
Chapter 9: Use the editor
1. Vim Editor
(For more details, see #1, #2, #3)
Start:Vim or Vim File
Two editing modes:Normal Mode and insert mode. Normal Mode is enabled by default.
Move the cursor:
H: 1 character left
J: move down a row
K: Move up a
I don't know when I wrote something, But I was found by archaeology when I sorted out the documents. I just smiled at those people who were bored. If the errors in this article cause all mental losses to you, contact the insurance company! Of course
Shell script Learning (1): Shell variables and some common commands
Shell allows you to create variables to store data, but does not support basic data type variables (such as int, float .....), shell interprets any value assigned to a
The case statementthe case statement is good alternative to multilevel if-then-else-fi statement. It enable you to match several
Values against one variable. Its easier to read and write. Syntax:
case $variable-name in
From: http://www.cnblogs.com/hanyan225/archive/2011/10/06/2199652.html
There is no doubt about the strength of shell, which makes it easier for us to confuse us. For example, I have always thought that I am smart and cannot tell you clearly.In Shell,
@ Rigorous use of set @
Set-eux
-E. If the command returns a non-zero value, exit immediately.
-U when the execution parameter is included, the unset variable is used as the error handling (if the extension attempt appears in the unset variable, the
Ls-l dir1 | WC-L.
1. While condition; do done // () [] Test2. Until is the same as above. It is executed only when the condition is not true.3. /Dev/null: Unix black hole. Used to clear the file CAT/dev/null> XX find-name a.txt 2>/dev/null4. Note:
I just learned shell and encountered a problem. The total error occurred during execution: Unexpected
Operator. I used Ubuntu 9. 04. I learned from laruence to go to the shell script section,
The script is as follows:
#! /Bin/bash
# Program:
#
Reprint: http://www.51testing.com /? Uid-225738-action-viewspace-itemid-218002
ShellProcessing
StringMethod (for future reference)
1. Construct a string
Direct Construction
Str_zero = Hello
Str_first = "I Am a string"
Str_second =
A wonderful article on arstechnicaCommentThe replacement of cmd.exe under Windows is described in detail. Microsoft command shell, also known as MSH, and the project code is monad. From the comments, mshdoesn't just make cmd.exe unable to look
6th hours Process
6.1 start a process
In UNIX, whenever a command is executed, it creates or starts a new process.
For example, when you use the LS command to list a directory, a process is started.
The operating system uses a five-digit ID called
12.3 option analysis in shell script
The first method is to use the case statement for manual processing.
Method 2: Use the getopts command to analyze the options
Syntax format:
Getopts option-string variable
Option-string is a string that contains
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