Li UX Shell arithmetic

I. Arithmetic of integers(1) Use Let expression, no need to add ' $ ' before variableLet sum=num1+num2(2) $[ expression ], before the variable can be added $, or not add $SUM=$[NUM1 + num2] sum2=$[$num 1-5] Sum3=$[num1 + 3](3) $ ( expression ),

Shell implementation Shuffle random

Shuffle question: Wash a pair of poker, what good way? Can be washed evenly, and can wash fast? How efficient is the order of chaos relative to a file? On the shuffle problem, there has been a good shell solution, here another three based on the

Shell base script execution, command aliases and shortcut keys, etc.

How scripts are executedFor example, we wrote a script under/root/, named Hello.sh. So how does the call execute it? There are two ways to do this:(1) Directly through bash, as follows:Bash hello.shNote: Execute scripts with bash and do not need to

Using awk to process large volumes of data in shell scripts

First, the demand      original file a for 1.7g file, with 5 1700 Mangyo look. There are also 2 auxiliary files b and C, b c files are only 2 column. a1 and b1 same, A2 and C1 a1 B2, c2" a4 a5, the target file is named d.txtSecond,

Part Three Shell Programming 3 (Shell Script 2)

7. If you judge some special usageIf [-Z $a] This indicates what happens when the value of variable A is emptyIf Grep-q ' 123 ' 1.txt; Then what happens if the 1.txt contains a ' 123 ' rowif [!-e file]; Then what happens when the file doesn't

Linux shell Scripts-Basic Learning Notes

Linux scripting is not too strong, and recently tutorial, after all, Linux shell in the daily work is still very common,It is more convenient to use, save time and effort.Here are the study notes, partial theory, followed by a few examples for

Linux Shell learning comes in mind

The Magical magic of awk:Extract the number 600 and note the special effect of the + sign.echo "Fuck 600ms" |awk ' {print + $NF} 'Result: Other characters are filtered, leaving only the number 600Using If,for in Commad mode#测试ifa=200if [$a = =];then

Shell Parenthesis Usage Introduction

Medium brackets [ and the test command equivalent, the user Boolean judgment, such as:1 a='abc'2if'abc' ] 3 Then 4 " Yes " 5 Else 6 " No " 7 FiEquivalent to1 if ' ABC ' 2 Then 3 " Yes " 4 Else 5 " No " 6 FiWhen using [], be

Shell Programming Instances---Implementing subtraction remainder of integers (by using read and script-pass methods)

Tag: null 1.read read mode: [[Email protected] scripts]# vim read_1.sh   1 #!/bin/bash   2 # Filename: read_1.sh  3 # Describe: Integer  arithmetic  4 # author: lijun  5 # date: 2015-08-24   6 # Version: 1.0.1  7    8 read -p  "please

FTP timed bulk download files (shell scripts and how to use them)

1. Script instanceSave the following script as getftp.sh# !/bin/bash datesign= ' date-d -95day +%y%m%d ' ftp -NV 12.2.2.28 ! Ftprunuser User01 User01 Prompt bin CD TXT LCD /app/info/getftpmget ${datesign}*. Txtbye! FtprunScript

Mac Install Shell tool zsh

Automatic installation:Of course, if you trust this open source project author, you can try to use the automatic installation method. wget Https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh-O-| Sh Manual Installation:1.

The regular expression of the shell script learning note

Basic Regular expression (supports shell tools such as Grep,sed,awk)* 0 or more of the ordinary characters in front of the * character. Match any character^ matches the beginning of the line, or the following character is non$ Match Line End[] Match

Special symbols in 1.4-shell

* Wildcard #注释 \ escape Character | Pipe character $ variable character; command delimiter!! Executes the previous command!$ the last parameter of the previous command ~ home directory & Command Background execution> correct override redirect >>

Shell script: While

The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is: while Command Do If True done The following is an example of a basic while

Linux shell reads rows of files line by line

Read a file line For Command substitution Code block redirection While Pipe character Code block redirection ForIFS=$‘\n‘forin-l`do (( count++ ))doneecho$countNote:For read,

Shell-Loop Statements

Script Programming Control Structure:OrderSelect: If, caseLoops: For, while, untilFor variable in List;doStatementDoneFor ((CONDITION));d oStatementDoneWhile Condition;doStatementDoneUntil Condition;doStatementDoneLoop Example: Test whether all

Linux Learning -10-Learning shell scripts

[Email protected] ~]# mkdir scripts; CD scripts[Email protected] scripts]# VI sh01.sh#!/bin/bash declaring shell names# program: Description of Procedure Content# This program shows the "Hello world!" in the Your screen.# History:# 2005/08/23 Vbird

[Algorithm] Shell sort

Public voidSortint[] list) { intGap = LIST.LENGTH/2; while(1 Gap) { for(inti = gap; i ) { intj = 0; inttemp =List[i]; for(j = i-gap; J >= 0 && temp Gap) {List[j+ Gap] =List[j]; } list[j+ Gap] =temp; } Gap= GAP/2; }}Shell sort,

Mikrotik RouterOS Script-peanut shell dynamic Domain name analysis

1, SETP1Turn on the NTP protocol and modify the time zone:/system NTP Client set Enabled=yes server-dns-names=1.centos.pool.ntp.org/system clock set time-zone-name=asia/ ShanghaiDetects if the route communicates with the dynamic Domain name

"Convex Shell" "Hnoi 2008" "Bzoj 1007" Horizontal Visible Line

1007: [HNOI2008] Horizontal visible LineTime Limit: 1 Sec Memory Limit: 162 MBSubmit: 4567 Solved: 1686DescriptionThere are n linear l1,l2 on the Xoy Cartesian plane,... Ln, if the Y value is positive infinity down, you can see a sub-segment of Li,

Total Pages: 541 1 .... 237 238 239 240 241 .... 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.