Shell script Operators

1. ValueFormat:Test "NUM1" OPR "num2"["Num1" OPR "num2"]OPR Value:Equality:-EQUnequal:-neGreater than:-GTLess than:-lt "L is the lowercase letter L"Less than equals:-leGreater than or equal to:-ge2. StringFormat:[Str1 OPR str2][OPR str]OPR

Shell Script intercept Date processing

[Author]: KwuDate formatting fixed to 8 bits in Linux: 2015-01-01String processing required for implementation in 2015-1-1#!/bin/sh# upload logs to hdfsyesterday2= "2015-01-08" Echo ${yesterday2}first=${yesterday2:5:1}second=${yesterday2 : 8:1}echo $

Shell Scripting Exercise 004

1.#!/bin/bashfor IP in 133 134 doname_8808= ' Nmap-p 8808,15080 172.16.1. $ip |sed-n "5" P|awk ' {print $} ' name_15080= '   Nmap-p 8808,15080 172.16.1. $ip |sed-n "6" P|awk ' {print $} ' if [$name _8808 = open-a $name _15080 = open] Then echo

The shell traverses the folder and executes the command

Background:There is a source package that contains many subdirectories and makefile, and the packed package is too large to be deleted and then packaged by all the binaries created by make.Demand:Therefore, make clean is required to clear all the

Shell programming shell script default variables ($, $ ...)

Default variable for Shell script ($ ...)We know that directives can have options and parameters, such as Ls-la to see all properties and permissions that contain hidden files. So can shell script have parameters behind the script file name? It's

Shell Script First Experience

Today I learned to write a shell script, a little excited, hereby recorded (actually not difficult to write it)Reason:Now do the projects that require multiple engineering dependencies, but the trouble is that there is no automatic association of

Linux Shell string Cutting built-in method

$MYSTR ="node=slave-01:2.05:1.25:1.00"$ time tmp=${mystr%%:*}; echo ${tmp##*=}real 0m0.000suser 0m0.000ssys 0m0.000sslave-${string#*pattern} minimizes matching pattern from the left and deletes (starting from the left) the first pattern

Linux-shell the size of the judgment

Combat 1: Enter 2 integers to determine the sizeThree ways to achieve:1 defining a variable 2 script parameter 3 read read-inThe first step, give the user prompt, let it enter an integerThe second step is to determine that the first value and the

Write a shell script to count the local traffic during a certain time period

Below is the output information of my wlan0 NIC, you can use Ifconfig or Ifconfig | Sed-n '/wlan0/,10p ' gets the format of the displayed informationwlan0     Link encap:ethernet  hwaddr xx:xx:xx:xx:xx:xx             inet addr:172.29.164.251  bcast:

What is a shell?

After the user logs on to Linux, a system prompt symbol appears, which allows you to enter a lot of commands after the symbol and get the desired effect, who is behind the scenes who is helping us with this whole pile of things? is the shell, and

Some common commands about the shell

Ls-lat list all the stuff in the current directoryLs-lath people look at the sizeLs-f | grep "/$" only DirectoryLS-LR include subdirectories ...LS--ignore filename-lt ignores a Which, in the path specified by the path variable, searches to see if a

Special characters for Shell scripts

1. #注释作用, #! Except in addition, in the parameter replacement echo ${path#*:} here does not represent the comment, the numeral conversion, does not represent the comment echo $ ((2#101011)) 2. Command line delimiter, you can write multiple commands

Shell two classes of execution methods

such as script scripts.sh1. Create a new shellAdd statement at the beginning of the scripts file: #!/bin/sh, via ./scripts.sh(requires execute permission) or sh scripts.sh(no execute permission required)2. Do not create a new shell, execute commands

Spark-shell First Experience

1. copy files to Hdfs:[email protected]:/usr/local/hadoop$ Bin/hdfs Dfs-mkdir/user[Email protected]:/usr/local/hadoop$ Bin/hdfs Dfs-mkdir/user/hadoop[Email protected]:/usr/local/hadoop$ Bin/hdfs

Shell Scripting Exercise 001

1. Practice Yourself#!/bin/basha=0while:d o a= ' expr $a + 1 ' if [$a-lt 4]then echo-n-E "input number 1 to 9 \ n" read Num case $Num in 1|2|3|4|5|6 |7|8|    9) Echo-e "You are number is: $Num!"   ;;    *) echo "R error number, game over!"  break;;

Shell Learning Note Five (special characters)

特殊字符 通配符 ?:匹配任意一单子符 *:匹配任意长度字符串 []:匹配其中任意一个字符,*、?在[]中是普通字符 引号 ""、‘‘ 注释符 # #!不是注释,但必须出现脚本的第一行 大括号 变量扩展 ${VAR} ${#STR} 通配符扩展 1、匹配多个排列组合的可能

Linux Shell six flow control--loop

One, for loop The For loop works by taking the serial element one by one out, putting it into the specified variable sequentially, and repeating the contained command area (between do and done) until all the elements takeUntil the end. Where serial

Acquisition of SP Shell Company

The application SP will have the requirements of registered funds, the whole network to reach 10 million, the net to reach a minimum of 1 million of registered capital, all need to be Chinese holding enterprises.  Frequently asked questions about

Shell disrupt file lines

Shell disrupt file lines The idea is to generate a random array, and then output the row in the file according to the array elements. 1. It is very easy to generate a random array. It was a little difficult to start using it for the first time. The

Shell breaks down file lines,

Shell breaks down file lines, The idea is to generate a random array, and then output the row in the file according to the array elements. 1. It is very easy to generate a random array. It was a little difficult to start using it for the first time.

Total Pages: 541 1 .... 476 477 478 479 480 .... 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.