For everyone to be lazy just ~ Write the steps in a script ~
Usage:
bootstrap.sh && gitosis-knstall.sh
GIT installation ~
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
CD
This article mainly introduced 8 practical shell script sharing, this article has given the judgment input number character, the character or other, asks the average, the self decrement output, adds the prefix in the file, the batch test file
1 if statement
echo "Please input X"
Read X
echo "Please input Y"
Read Y
If [$x-gt $y]; In the [] condition, there must be a space before the [only space is followed]. Only a semicolon can be available, or there can be no semicolon
Then
echo "
Friends who know more about operating system principles will know that a complete operating system provides a shell (shell) to make it easier for ordinary users to use the various features provided by the operating system. Windows (here refers to
#========================start shell Script ============================#!/bin/bash# defines the user name and password to use when backing up the database db_user= "root" db _passwd= "111111" #定义FTP服务器地址, user name, password, directory Ftp_url=113.1
Write automated, fully-prepared shell scripts based on mysqldumpOn-line MySQL database backup is divided into full standby and add-on, while Xtrabackup backup already supports incremental backup, but mysqldump does not support incremental backup, so
number of logged-in users: who | Wc-l
See which users are logged on to the system : who
Create a new file /bin/ct11, enter a command in the file,chmod Set the Execute permission for the file
# cat >/bin/ct11W.H.O. | Wc-lPress Ctrl+d# Cd/
Shell Advanced StepConditional Select if statement to achieve conditional judgmentIf syntax: if Commands;then commands (if the command is true, the subsequent command will be executed, fi ends;)Elif Commands;then Commands (if the previous if is not
* Represents 0 or more arbitrary characters[[email protected] ~]# ls *txt11.txt 1.txt 22.txt 2.txt aa.txt a.txt? Represents only one arbitrary characterWhether it's a number or a letter, as long as it matches a single character.[email protected] ~]#
When it comes to programming, we are all not unfamiliar, but in Linux, we mainly do script writing. Of course, in order to understand the scripting of Linux, we have to first say the logical relationship of multi-command execution.1. Command
4.1 Monitoring procedures1. PS defaults to only the processes that are running under the current console that belong to the current user. You can take many options, such as-a for all processes-E, and so on.2. Ps-l View process More informationUID:
##################################################################################################Shell script:Scripts: Files that can be executed, implemented after running a certain function (command stacking, interactive)Standardize the general
Error in console when executing. SH script: #!/bin/bash:no such file or directoryWorkaround:Cat-a file pathYou'll find the first line is a problem.M-oM-;M-?#!/bin/bash$#----------------------------------$#$# M-eM-^PM-/M-eM-^JM-(M-hM-^DM-^ZM-fM-^\M-,
logical operators
logical operators used in [] and test
logical operators used in [[]]
Description
-A
&&
And and, both ends are true, then true
-O
||
Or OR, at both ends
Vulnerability overviewApache struts is an open source project maintained by the Pachitea (Apache) Software Foundation, an open-source MVC framework for creating enterprise-class Java Web applications. An arbitrary code execution vulnerability exists
1. Write a scriptThe script can accept more than one file path as a parameter;Displays the number of rows held by each file;Shows how many files have been executed for the number of rows this time.#!/bin/bashfor file in $*; Do lines= ' wc-l $file |
1, the syntax of the script structure:Shell script is a "program" written using the function of the shell, which uses a plain text file (the file suffix is preferably sh file, which is convenient for us to manage), and writes some shell syntax and
I. Source of the problemSometimes copy some important data, and then need to check with the original data whether the data is consistent. This requires a checksum.Two. Analysis of the problemThere are several ways to verify the data, and the
First, the Hive function1. Hive Built-in function(1) More content, see "Hive Official Documents"Https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF(2) Detailed explanation:Http://blog.sina.com.cn/s/blog_83bb57b70101lhmk.html(3) test
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