I've used the bash shell, and it's not a short time. But I've never learned to shell, at least not so seriously as C + +. Usually write some basic script no problem, do not understand can also Google, Baidu. On the last day of 2014, it fell into the
The 1.bash shell is the default shell command interpreter for most Linux distributions, but a recent burst of bash shell has been exploited.2. If bash is the default system shell, network attackers can attack servers and other Unix and Linux devices
Processing of parameter processing-shell incoming parameters
$#The number of arguments passed to the script
$*Displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be
Shell command:The shell recognizes three basic commands: Built-in commands, shell functions, and external commands:The built-in command is the command executed by the shell itself. Some orders are built on the basis of their necessity, for example:
Today is too lazy, do not want a characteristic of a feature to statistics, and write a script#!/bin/bashdir_bas=$ (CD $ (dirname ${0});p wd) a= ' cat $dir _bas/feat ' feat_bas=$1total=0for B in $Ado echo $B Count= ' grep ' $B ' $feat _bas |
egFor example, when running rails's own server under Linux, this command is required rails_evn=production rails S is not a bit verbose, every time to hit so many words, can not tolerate, fortunately, we have shell script help. Create a script of
There are a bunch of host addresses:A.baidu.com...Z.baidu.comHow to extract the. Baidu.com letters from these data, such as: a b...z?When you see the problem, you first think about how to generate the file with a script:Ideas:1. Definition suffix:
A shell script is typically a one-time execution of the entire file, meaning the entire file is equivalent to the main function. But I just want to run the specified function. In fact, you can run using the function name as a parameter to run, it
Shell Background Run Programhttp://blog.csdn.net/courage89/article/details/10561041
& is most often usedThis is used at the end of a command, you can put this command in the background to execute
CTRL + ZYou can put a command that is
Gzexe encrypts shell scripts 01
Gzexe encrypts shell scripts 01
I. Introduction
Most of the time, our script involves some private information, such as the user name, password, or other important information. We use some encryption methods to block
Frequently used shell commands (updated in succession) and shell commands
It's just something that I often use, not comprehensive.
1. Obtain the returned values before the MPs queue.
Echo $ {PIPESTATUS [0]}
E.g.
root@node2:~# date1 | echo 22No
Common shell commands (updated in succession)
1. Obtain the returned values before the MPs queue.
Echo $ {PIPESTATUS [0]}
E.g.
root@node2:~# date1 | echo 22No command 'date1' found, did you mean: Command 'date' from package 'coreutils' (main)date1:
Shell programming cut, shellcutCut refers to the unit of action in the file. Based on the conditions you set, part of the content is cut and printed out. Output to standard output, not saved to any file-B Range: determined by byte range-c range:
Shell programming-sort and shellsortThe sort sorting operation sorts a row in one or more files according to the set rules. Output to the standard output and will not be saved to any files.-T specifies the filed separator. The default value is space.
MacOSXRAMDisk (memory disk) Shell
This article provides the ghost version of Mac OS X RAM Disk (memory Disk) Creation Program and practical instructions.Concerns
When Mac thunder downloads, The IOPS is too high. It may be because the cache is not
Linux shell programming process control, linuxshell
If statement:
Test is used in the past.
Example 1: When the hard disk exceeds 80%, notify the Administrator
Example 2: Automatically Restart Apache when it is disabled
Example 3:
Linux shell programming location parameter, linuxshell
Location parameters are a special shell variable used to pass parameters to the program when running shell.
$0 indicates the Script Name;
$1 indicates the first parameter, $2 indicates 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