It's nice to install fish shell today and install oh-my fish.But it is still a preliminary attempt and more features are not known. Install Fish
sudo apt install fishSet as Default shell
Chsh-s/usr/bin/fish
If you want to switch back to bash,
This article mainly describes how to output colored content in a shell script.
In a shell script, both Echo and printf can output content. Let's look at the following example
Echo-e "\033[43;35m David use echo say hello world \033[0m \ n"
printf "\
In the company's intranet configuration cluster synchronization, may be a proxy problem, NTPD and chrony are not used, so had to write shell script to solvePrerequisites for each machine in the cluster has been configured with a password-free
Conclusion:By default, the variables for the parent shell and child shell are isolated.SH mode to run the script, it will re-open a child shell, unable to inherit the normal variables of the parent process, can inherit the parent process export
echo Outputecho instruction for the output of a stringFormat: Echo stringDirect output String: stringEcho ' This is String-output 'In double quotes, you can also omit quotes here.Escape character: \echo ' \ ' It is ok\ 'Variable: \valueEcho ' \value
Shell script programming includes process control, functions, arrays, advanced string manipulation, and advanced variables, where the main introduction to Process control.Process Control is mainly a process programming language, which is divided
Sort command, The parameter-u removes the duplicate rows in the result,-T, changes the delimiter,-N sorts by number size, and-K specifies the sorting field. eg: Sort-T:-k3n gargo. DB # sort by number in the Third Region
Sort-T:-k3nr gargo. DB #
It is necessary to specify the value of the command line option in the script. Getopts provides a way to place a colon after the option_string option, for example:
Getopts abcsd: Option
ABCs can be passed without adding actual parameter values,
RecommendedArticle:
APIS for file path operations in Shell
Http://www.cnblogs.com/fangkm/archive/2009/04/15/1436674.html
I wanted to sort it out by myself, but I found the above article by Google according to the title of the phenomenon, and I
Sort
The sort command sorts the rows in the file specified by the file parameter and writes the result to the standard output. If the file parameter specifies multiple files, the sort command connects these files and sorts them as one file.
Sort
Hill sorting was named by computer scientist Donald L. Shell. He discovered the hill Sorting Algorithm in 1959. Hill sorting is based on insert sorting, but a new feature is added, which greatly improves the execution efficiency of insert
Compile a simple shell command parser
Environment:
RedHat 9.0 kernel 2.4.20
VI document editor 6.1.320
GCC 3.2.2-5
Steps:
Step 2: Write the simplest shell command interpreter. This program is taken from apue Example 1-5. The command cannot
In makefile, shell commands are often used, and $ VaR are often used. What is the difference? The difference is big. Do not consider using $ VaR in the command line of the makefile rule to share the variables of makefile with the shell. Here, only
Download an e-book in chm format:Http://download.csdn.net/source/2843130
Note: I did not write this book. I just compiled it into an e-book for your convenience.
A good definition of an operating system shell is that it is a user interface
Sed (a stream editor)
Four spaces: input stream, pattern buffer, output stream, and hold BufferThe basic operation process is:(1) Put the current row of the input stream into the pattern buffer, and then the pointer of the input stream points to
Reprinted: http://blog.csdn.net/zuolongsnail/article/details/8167501
Run ADB shell AM broadcast on the command line to send broadcast notifications.
Parameters following ADB shell AM broadcast include:
[-A ][-D ][-T ][-C [-C ]...][-E | -- es ...
Shell file operation functionsShfileoperationFunction:1. Copy one or more files2. delete one or more3. Rename the file4. Move one or more files
The same WIN32API function is:Copyfile (), deletefile (), movefile ()Movefile can be renamed!Win32 API
2. In some software installation processes, you need to create an independent user and then run some installation operations such as gitolite installation, create a git user and execute the installation.
Method 1:sudo -u user ...
Sudo-u Git-H
Install and use a peanut shell (Linux). I did this:
First you have to have a peanut shell account, must apply to the http://www.oray.com. Follow these steps.
1. Open the Web http://www.oray.com/peanuthull/download_linux.php In the XP BrowserButton
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