Shell numerical calculation, fractional calculation

In a shell script, you can perform numerical calculations,如加减乘除,通过expr、let、(())等完成,文章介绍:http://blog.csdn.net/longshenlmj/article/details/14166193但是上面的运算只支持整数。小数计算怎么办?Shell small number calculationComplete with Bc,awk and Nawk tools, etc.The code for

Shell learns 52 days----Delete process kill command

Control and deletion of processesUseKillcommand to terminate a process.usually,terminating a foreground process can be usedCtrl + CKey,However, for a background process, you must use theKillcommand to terminate,we need to first

Shell script: If-else

The Shell has three kinds of if ... else statements:1.if. FI statement;2.if ... else ... fi statement;3.if. Elif ... else .... fi statement.If ... fi statementSyntax for the IF ... else statement:if [Expression] Then If Truefi Note: There must

SSH login of common shell in work do not enter "yes"

ip= "192.168.5.166"SSH $ip-o stricthostkeychecking=no//SSH login do not enter "Yes"Port= "26092"Pid= ' Netstat-anlp|grep $port |awk ' {print $7} ' |awk-f '/' ' {print '} 'Pname= ' ps-ef|grep $pid |grep-v grep|awk ' {print $NF} 'Dir= '

Shell learns 46 days----file system spatial information df and DU commands

Spatial information for file systemsDF CommandDfcommand provides a single-line summary,a row shows the used and available space for a loaded system of asking the price.the unit depends on the system,some use blocks,some of them areKB.Most modern

Script receive options for shell scripts

1. Create a script that can add script information to other scripts:#vim cs.sh#!/bin/bashCat > $ #!/bin/bash#Name: ' BaseName $ '#Description:#Author: TEST#Version: 0.0.1#Datatime: ' Date ' +%f +%t "'#Usage: ' BaseName $ 'EofVim +8 $2. Modify the

Synchronizing files remotely by using SCP or rsync in a shell script

The simple use of the remote SCP file shell expect is implemented in shell scripts with expect http://myunix.blog.51cto.com/191254/1095074http:// Jie-hui-520.blog.163.com/blog/static/60074301201022610217249/linux rsync Synchronous Practice Http://my.

NPM should be run outside of the node repl, in your normal shell

Node version: v0.12.4When installing NPM install-g-supervisor is present:NPM err! AddLocal Could not install D:\Program Files\nodejsNPM err! Windows_NT 6.3.9600NPM err! argv "D:\\Program files\\nodejs\\\\node.exe" "D:\\Program files\\\\node_modules\\

Linux shell in while with read from keyboard input

The system is Ubuntu 14.04 64bit, previously wanted to install stream to play dota2, but eventually did not succeed. Because stream is only 32bit, a large number of 32bit libraries are installed when the stream is installed. Delete the stream, these

Shell Script (iii)

Shell Script (iii)2. File sorting, merging and segmentation(1) Sort command#-c: The test file is sorted;-K: Specifies the sort field;-M: merges two sorted files;#-n: Sort by number size;-o: Writes output to file;-r: Reverses sorting results#-t:

Linux Shell If Judgment statement

No matter what programming language is inseparable from conditional judgment. The shell is no exception.The approximate format is as follows:If List ThenDo something hereElif List ThenDo another thing hereElseDo something else hereFiAn

Description of the IF, while, for statement for the shell of Linux

I. Basic conditions of judgment1) Logical operators-A expr1-a expr2 logic and-O expr1-o expr2 logic or! !EXPR1 Logical Non-2) Numerical judgment-eq num1-eq num2 is equal-ne Num1-ne num2 is not equal-GT NUM1-GT num2 is greater than-ge Num1-ge num2 is

Featured 37 powerful common Linux shell command combinations

Task Command combination 1 Delete a 0-byte file Find. -type f-size 0-exec rm-rf {} \;Find. Type F-size 0-delete 2 View processes, sorted by memory from large to small PS-E-O "%c:%p:%z:%a" |sort-k5-

A 9*9 multiplication table written in shell script

The 1 script is as follows[[email protected] ~]# vim 99.sh #!/bin/bash # 9*9 Table # 2015.5.26 by Luzhi for i ' {1..9}do for J ' {1..9} do If [$j-le $i] then c=$ (($i * $j)) ECHO-E-n "$j * $i = $c \ T" fi do echo "" Done2 Operating effect650)

Shell Monitoring Script 1

#!/bin/sh#count memory_used_rate,disk_used_rate # @yuanwb  2015-5  #disk_used_rate #depend  on real storage place the parameter  ' Location '  need to  Alter. location=/dev/sda1disk_used_rate1=$ (df -h | grep  $Location  | awk  ' {print $5} ') free1=

Shell Monitoring Script 3

#!/bin/sh#count memory_used_rate,disk_used_rate # @yuanwb  2015-5  #disk_used_rate #depend  on real storage place the parameter  ' Location '  need to  Alter. location=/dev/sda1disk_used_rate1=$ (df -h | grep  $Location  | awk  ' {print $5} ') free1=

[Linux]shell Multi-process concurrency-detailed version

Business backgroundThe schedule.sh script is responsible for scheduling the execution of the user's trajectory engineering script, and intercepts some of the code as

Experiment one user interface with Shell commands

First, experimental hours: 2 hours second, the purpose of the experimentV is familiar with the Redhat_linux user interface and makes common system settings.V Master the Common shell commands.Third, the experimental environmentV A computer running an

Shell Script View apk signature information

Wrote a script to view the APK signature with the shell. The code is very small and simple.Supports recursive directory queries#!/bin/bash# how to use the./getcertificate.sh xx.apkget_signature () {path= ' jar tf ' $ ' | grep RSA ' #查找apk中RSA文件 jar

Direct Insert Sort, binary insert sort, shell sort, bubble sort, select sort

first, direct insertion sortStability, time complexity: preferably O (n), worst O (n^2), average O (n^2). Space complexity O (1)void Insertsort (int l[], int n) {int I, j,key;for (i = 1; i= 0 && Key two or two points insert sortFinds the insertion

Total Pages: 541 1 .... 168 169 170 171 172 .... 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.