#!/bin/shsum (){echo $ (($1+$2))return $ (($1-$2))}Sum $c=$ (sum $)echo $?Echo $cExecute command:./bashtest 1The operating result is:12--sum Results10--echo $? result because the value of return is ten12--echo $c result, the value is 12, so C will
The Find command, like a CD, is often used. But perhaps most of the time as long as the one or two parameters are enough to use. Or, it's a little too much. But when we take the initiative to look at the handbook of Find, we will find that the
The format of the IF in the shell:If [conditions]ThenExprelif [conditions]ThenExprElseFi[Conditions] includes1.!,-A,-o2.-n,-z, =,!=3.-eq,-ge,-gt,-le,-lt,-ne4.-ef,-nt,-ot5.-b,-c,-d,-e,-f,-g,-g,-h,-k,-l,-o,-p,-r,-s,-s,-t,-u,-w,-xType 1 is a logical
I. What is a shell? 4.shell provides a way for you to communicate with the operating system. There are two kinds: a.Interactive mode:(Input from the keyboard and can be immediately responded to) in fact, one command is entered at a time;B.
title:createlivecmsv4.0 vulnerability, no background get shell--2012-03-06 17:28Title: createlive CMS Version 4.0.1006 Vulnerability without background Get shellRequired environment: IIS6, upload directory executable scriptCreatelive CMS Version 4.0.
Title:kesioncms V6.5 Back Shell method--2011-03-29 00:21Recently get a site, is kesioncms V6.5 Web system, try to take Webshell method under the background, write down.1.The new x.asp user, combined with the IIS folder Resolution vulnerability, is
Write an SSH anti-violence hack script.The principle is to detect the SSH connection log, filter the login failed IP, more than the number of login to add it into the Hosts.deny file, limit its login.The script is as follows:#! /bin/bashcat /var/log/
Remember that if and the [] are whitespace1. String judgmentSTR1 = str2 When two strings have the same content, length is trueStr1! = str2 True when string str1 and str2 are not equal-N str1 True when the length of the string is greater than 0
Variable Description:$$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
First, regular expressionPeriod. Matches any single character, such as a. Represents two characters after a match^//Match the beginning of the line, such as ^w, to match the W at the beginning$//matches the end of a line, such as x$, that matches
I. Review of BASIC commandsDate//day and time displayedWHO//view all users logged in to the systemecho//Display the input contentFile Operation classLS//List file listCAT//Display file contentsNumber of words in WC//statistics fileCP//Copy
A few examples of shell scripts, feel good." Example: 001 " judging the input as a number, character or other #!/bin/bashread-p ' Enter a number or string here: ' Inputcase $input in [0-9] ' echo-e ' good job, Your input is a numb eric! \ n ";
1. Internal parametersThe above process is an internal variable, which is required to represent the program itself, and $ $ is optional. The same internal variables as $ A are as follows.$#----The total number of parameters passed to the program is $
The nature of the test:is an action commandDetermine if the condition is true based on the $? return valueOperating Specifications:Format 1:test conditional expressionFormat 2: [Conditional expression]Contact method for the test operation:Direct
First, look at Linux under:Copy CodeThe code is as follows:#! /bin/bashcd/ftp/Currentdate= ' Date +%y%m%d 'Yesterday= ' date-d yesterday +%y%m%d 'Threedayago= ' date-d ' 3 days ago ' +%y%m%d '#echo $TWODAYAGOFtp-n-I 34.97.34.3 User Ftpuser
Linux shell string truncation and splicing, linuxshell
Linux string truncation is very useful. There are eight methods.
Assume there are variablesVar = http://www.hao.com/123.htm
1 # intercept, delete the characters on the left, and retain the
Shell Escape Character collation
Escape: place the backslash (\) before the character to be escaped, indicating that the character should be considered as a common character.
When sed awk is used, escape characters are occasionally used.
For
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