Digress: Recently, due to an attempt, we installed and set the highly recommended zsh to replace the default Bash. After a while, we found that there were a lot of things, but the same problem was also exposed, for example, there is a problem with
Windows powershell cmdlet
The cmdlet (read as "command-Let") is a single function command used to operate objects in Windows powershell. The name format can be used to identify the verbs and nouns separated by hyphens (-), such as get-help,
In the 1980s s, most applicationsProgramIs to provide a command line analyzer-even now, this is also very important. For many years,. net has been missing a standard analyzer, so developers have to implement this common mode over and over again.
In
/** Reference address of this article: * /// Note: If I use ubuntu11.4 and run shell script sh test, an error is returned. Run/bin/bash test to obtain the correct result.
String Truncation in Shell
STR = "abc123abcabc"
# Calculate the length of
In the Linux Shell environment, two regular expression rules are provided. One is the basic regular expression (BRE), and the other is the extended regular expression (ERE ).The syntax list of these two expressions is as follows. Note that, if meta
$0 script execution name
$ N the nth parameter value of the script, n = 1 .. 9
$ * All parameters of the script
$ @ All the parameters of the script (which have similarities and differences with $)
$ # Script parameter count
$ PID for Script
I. Input and Output 1. standard file descriptor
Each process can have a maximum of nine open file descriptors: 0 -- stdin, 1 -- stdout, 2 -- stderr.
(1) stdin
For terminals, stdin is the keyboard.
When the input redirection symbol (
(2)
1. Use shell programming to determine whether a file is a block or character device file. If it is copied to the/dev directory.
#! /Bin/bash# 1.sh# Determine whether a file is a character or a block device file. If it is copied to the/dev directory#
Before calling shell, you must follow these steps: (perform operations in the E: disk root directory as an example)1. force change the current drive: chdrive "e"2. force change the default working directory: chdir "E :/"After completing the
Shell programming usually requires operations on strings. Sometimes, you need to convert strings into numerical values and perform addition and subtraction operations. The following describes how to convert a string into a numeric value and
1. How to use echo to output a string STR = "-n". Because-N is a parameter of ECHO, the General echo "$ Str" method cannot be output.The solution can be:Echo x $ STR | SED's/^ x //'Echo-ne "$ STR \ n"Echo-e "$ STR \ n \ c"Printf"% S \ n" $ STR (this
1 #! /Bin/bash 2 3 # variable assignment and replacement 4 5 A = 375 6 Hello = $ A 7 8 # --------------------------------------------------------------------- 9 # note that when assigning values, do not have spaces before and after the equal sign. 10
Linux Shell is much more powerful than Windows batch processing in programming, whether in loops or operations. Data Types cannot be compared. The following is a summary of some operations on the array when I am using it.
1. array
Set in cron and execute at every Monday (full backup every Monday, Incremental backup for the rest of the time)
# Vi backup. Sh
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#! /Bin/bash
#
Windows supports a total of seven shell extensions,
They are:
Copy hook Handler)
Context Menu Handler)
Drap-and-drop Handler)
Icon Handler)
Property sheet Handler)
Drop target Handler)
Data Object Handler)
The copy hook handler is a simple shell
1, note:Ulimit is used for resources occupied by Shell startup processes.2. Category:Shell built-in commands3. Syntax format:Ulimit [-acdfhlmnpsstvw] [size]4. Parameter introduction:-H: Set hardware resource limits.-S: Set software resource
This article is also the fifth chapter of "Learning the bash Shell" 3rd Edition, five of Flow Control's reading notes, but we will not limit it to this. Flow control is a common part of any programming language, including while and util, which are
This article Reprinted from http://www.linuxsir.org/bbs/thread362001.html? Pageon = 1
Terminal (terminal, or physical terminal ):
It is a device, not a program. Generally, it is a device that provides a command line user interface, typically a
// Use shell to search for multiple files find. -type f | xargs grep flash description: find the files in the front directory and Its subdirectories that contain flash files // record the xargs command: xargs obtains the parameter list and 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