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
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
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
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
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
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.
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)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:
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
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-
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)
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
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
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
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
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