About the return value of functions in the shell

#!/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

8 Shell Command's find

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 IF format of the shell

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

Shell Small Command combat: Get the same network segment host

#!/bin/bash#test  alive  ipa=1while :d o    a=$ (($a + 1))      if test  $a  -gt 255    then break     else                 ip_addr=$ (ifconfig | grep inet | head -n 1 | awk  ' { print $2} '  | awk -F :  ' {print $2} ' | awk -f .  ' {print  $1 "." $

I. Shell BASIC Concepts

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.

CreateLiveCMSV4.0 vulnerability, no background get shell required

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.

Linux Display login Shell information

Linux Display login Shell information[Email protected]:~$ finger-plogin Name Tty Idle Login time Office Office Phoneyouhaidong youhaidong *:0 Mar 8 22:10 (: 0) youhaidong youhaidong pts/0 Mar

Kesioncms V6.5 Back Shell method

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

SSH anti-brute shell script

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/

The judgment statement in the Linux shell

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

Special usage of $0,$?,$! in shell

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

The Linux shell script traverses all the files in the folder

#!/bin/bashfunction ergodic() { For file in ' ls $' d o                      if [-D $1 $file ] #如果 file exists and is a directory is true                      then                        ergodic $ 1 "/" $file        

Unix Shell Programming Notes series (II)

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

Unix Shell Programming Notes series (i)

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 good shell scripts

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 ";

Shell Script-tips

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 $

Linux-shell Test

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

Automatic FTP scripting (shell Bat) under Linux and Windows

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 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

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

Total Pages: 541 1 .... 428 429 430 431 432 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.