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
1. Basic Knowledge
CAT/etc/ShellCHSH/bin/tcshEmacs = Vi?PdkshZsh
B C KPID is 1 not 0
Home variables exists in passwd, And the last entry of passwd is sh.
PS-Ef svr4PS au for BSD/Linux ps
Echo $ statusEcho $?
EUID // can be changed, like
Introduction to kernel, shell, and bash
First, let's talk about what is kernel:The kernel is the core of Linux. All user operations are completed by the kernel, but the user does not directly perform all operations on the kernel. Why? Because there
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)
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
Unix shell programming (3)-Regular Expressions of Unix shell
Match any single character: Period (.)For example, "R." indicates the pattern that matches "R" with any character.
Match the first line: ^For example, ^ George indicates matching rows
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
Introduction and use of shell commands
1. What is shell?In computer science, Shell, commonly known as shell, is a software (command parser) that provides user interfaces ). It is similar to command.com in DOS. It receives user commands and calls
Not long ago, I saw two very interesting commands-script and srciptreplay, which can record terminal sessions to a file, that is, we can use terminal sessions to create command line skills video tutorials, you can also share session files with
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
Using ubuntu10.04 these days, multiple instances of the same program will always be opened, such as Firefox/chromium, and so on, so I wrote the following script to enable the function of only one instance:
#! /Bin/sh# Name: One# Auther: maxupeng#
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
#
#! /Bin/shwebsite [0] = 'zufang .hfhouse.com/chuzu/' # Website 1 mobile [0] = '000000' # Website 1 mobile number website [1] = 'oldhouse .hfhouse.com/chushou/' # Same as 2 mobile [1] = '000000' # Same as above 2 # and so on, if there are too many
1. ECHO Displays a line of strings to the standard output.
0) some details of the ECHO command are different in System V, BSD, and Linux like-Unix systems, which are mainly Linux systems.
1) usage: Echo [-E] [-N] string
① String: string is the
This article is the seventh chapter of "Learning the bash Shell" 3rd Edition, "Input/Output and Command-Line Processing. Our goal is to read books thin.
Echo and printf are both written. read is used for reading. The format is:
ReadVar1 var2...
This article is also the first chapter of "learning the bash shell" 3rd edition, the Reading Notes of bash basics. But we will not limit this. Bash is used in Linux and has never been systematically studied.
Some I/O operations
Linux I/O has two
// 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 operating system shell is defined as a user interface provided by the system. It allows users to execute public tasks, such as accessing the file system, exporting execution programs, and changing system settings. Ms-dos has a command.com role.
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