Shell base SED usage

SED: Line processing command, default does not modify the original file, only the data in the pattern space to do processing, after processing, the mode space to print to the screensed [options] ' addresscommand ' file ...-N: Silent mode, content

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.

Shell Pattern Matching

Special characters in shell pattern matching * Matches any string (including an empty string). ? matches any single character . [...] Matches any character that is contained.

Reference usage description for shell scripts

#!/bin/bash#演示全引用和部分引用#双引号和没引号的区别variable1=2010echo "$variable 1"echo $variable 1variable2= "x y z" # #字符之间用多个空格隔开echo "$variable 2" # #双引号echo $variable 2 # #没引号#单引号和双引号的区别echo "$PWD is the current directory." # #双引号Echo ' $PWD is the current

"Shell" tar command details

tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the

Base shell Script

#! /bin/shA= "Hello World"echo "A is"Echo $aecho ""echo "A is $a"Results of the output:A isHello WorldA is Hello World2 Getting the system time:Get today's period: ' Date +%y%m%d ' or ' date +%f ' or $ (date +%y%m%d)Get yesterday's period: ' Date-d

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

Scripting Shortcuts: A tool for simplifying shell Terminal command input

1. Issues to solveWhen you need to enter a number of commands at once , such as deleting files in multiple directories at onceCD Dir1RM file1.tempCd.. /.. /dir2RM-RF Dir3When you are too lazy to enter a good long command or simply can't remember

SHELL Variable Summary

Positional variables$ A Gets the file name of the current user script contains the path$n gets the nth parameter of the currently executing shell script if n is greater than 9 in curly braces ${10}$# gets the number of arguments for the currently

Summary of methods for intercepting strings in the shell

There are a number of ways to intercept strings in the shell, and there are 9 ways to use ${expression. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}

A small question about variables with double quotes when grep in a shell script

When writing a shell script today, one of the actions is to use the grep command to search for the specified content in a file. Specifies that the content is stored in a file, using a variable to get the contents of the file, and then uploading to

Automatically implement Hadoop decommission shell script version

IntroducedBefore I had a blog post that describes how to automate Hadoop decommission with Ansible playbook, this article describes using shell scripting.The scripts are placed on the springboard machine, and the remote server calls the local script

Operator differences for Shell numeric and string comparisons

Numerical comparison:N1-eq n2 Check if N1 equals N2 n1-le n2 check N1 is less than or equal to N2N1-ge n2 Check if N1 is greater than or equal to N2 n1-lt n2 check N1 is less than N2N1-GT n2 Check if N1 is greater than N2 N1-ne N2 check N1 is not

Shell $! The meaning of $#

The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number of parameters for this program$$ the PID of this program (the current

Return values of functions in Shell

Return values of functions in Shell#! /Bin/shSum (){Echo $($1 + $2 ))Return $($1-$2 ))}Sum $1 $2C =$ (sum $1 $2)Echo $?Echo $ cRun the command:./bashTest 11 1.The running result is:12 -- result of sum $1 $210 -- echo $? Because the return value is 10

Introduction to Sed Regular Expressions in Linux shell scripts, shellsed

Introduction to Sed Regular Expressions in Linux shell scripts, shellsedSed IntroductionSed is a lightweight stream editor, short for stream editor. Sed is also called a row editor because it is used to edit a file in a behavior unit. It can

Shell script programming 2

Shell script programming 2 Custom environment variables (global variables) Set Environment Variables If you want to set environment variables, you must use the export command after assigning values to the variables or setting the variables, declare

Total Pages: 541 1 .... 480 481 482 483 484 .... 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.