Create a two shell script file. The test1.sh code is as follows:#!/bin/bashurl= "Http://www.cnblogs.com/freescience"The test2.sh code is as follows:#!/bin/bash# use. To reference the test1.sh file. ./test1.sh# or use the following include file code #
Built-in judgment, when successful returns 0, does not successfully return nonzeroTest-judging expression[Judgment expression] Note must be left blank before and afterNumeric operations-eq equals-ne Not equal to-GT Greater than-ge greater than or
1 ${parameter%word} and ${parameter%%word}${parameter%word},word is a pattern that starts at the end of the parameter parameter and matches it forward. A single% makes the shortest match, that is, matches from the back forward, and encounters a
Want to write a script, found that all forget, egg pain, while recalling the side of the writing, finally finished, affixed to the following:1#!/bin/Bash2 #Program:3 # can help you quickly redeploy the project4 #History:5# ./ ,/TenShichaogeng First
1. Direct to the code: I am this is two programs. Most likely to write a function[email protected] src]# cat checkprocess.sh#!/bin/bashCheckprocess (){Ps-ef|grep $1|grep-v grepIf [$?! = 0];thenSystemctl Start $Elseecho "It ' s
1, get the character from the front 8, the implementation method is as follows:a=123456789$ expr substr $a 1 8$ echo $a |cut-c 1-8echo $$ echo $a |dd Bs=1 count=8 2>/dev/null2. Interception by the specified string(1) The first method:A string after
#shc是一个专业的加密shell脚本的工具. Its role is to convert the shell script into an executable binary file, which is a good solution to the script contains IP, password and so do not want to open the problem.HTTP://WWW.DATSI.FI.UPM.ES/~FROSAL/SOURCES/SHC's
/etc/shells more/etc/shells/bin/sh/bin/bash/sbin/nologin/usr/bin/sh/ usr/bin/bash/usr/sbin/nologin/bin/tcsh/bin/cshECHO-E Related escape character\ \ input \\a Output Warning tone\b Backspace, i.e. delete one character to the left\c Remove line
Overview of the SED tools (streaming editor)Non-interactive, filter and modify text based on pattern matchingLine by row and output the results to the screencan achieve the output of the text, increase, delete, change, check and other operationsSed
(1) Please follow the date format (XXXX-XX-XX) to generate a daily file, such as the file generated today is 2017-07-05.log, and the use of the disk to write to this file, (do not consider Cron, just write the script can be)!#! /bin/bashd= ' Date
Turn from: Some tips for getting a shell1. Upload asp asa jsp cer PHP aspx format of the Trojan, do not add a space or use IIS6.0 Parsing vulnerability, common format: 1.asp;1.jpg or 1.asp;. JPG or 1.asp;jpg2. Sometimes upload the image format of
Input/Output
Display on the monitorRedirect to FileStandard file descriptor0 STDIN Standard Input1 STDOUT Standard output2 STDERR standard error redirect error message when you need to develop a file descriptor Ls-al badfile 2> test11111Ls-al
$$the PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?end code of the last Run command (return value)$-flag at a glance using the SET command$*all parameter lists. such as "$*" in the Case of "" ", in the
First, the method of removing the empty lineSometimes when we process and view files, there are often many empty lines, in order to beauty or need, it is necessary to remove these lines, the method is as follows:1) using the TR commandCopy the Code
Reprinted from: http://www.cnblogs.com/sheldonxu/archive/2012/06/25/2560770.htmlIn a shell script, you can get the nth parameter in a $n way, for example, a script named Paramtest:#!/bin/bashecho $The result of executing./paramtest a B is to print
Huawei bids (do not want to spit) a variety of reasons can only use HBase shell query, in this record of their own exploration of the hbase shell to avoid the next time you have to findScan ' ogg_sel_ioc_sv_product_name_info ',{filter=>
BASH: Weakly typed languageVariable type:Environment variables, local variables (local variables), positional variables, special variables1. Local variables: Only valid in the current process, parent-child shell is not universalDeclarative method:
1. Batch generation of random character filenamesUse the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy, with the following name
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