Testing and comparison of shell scriptsTest command: Checks the file type and compares the value (depending on the execution result of the expression (true or false), returns an exit status. )NAMETest-check file types and compare valuesDESCRIPTIONExit with the status determined by EXPRESSION.***************************************************************************************File Test operators:-d (directory) file exists and () is directory, returns true-F (file) file exists and () is normal f
-ot filename2 If filename1 is older than filename2, then true [/boot/bzimage-ot Arch/i386/boot/bzimage]String comparison operators (note the use of quotation marks, which is a good way to prevent whitespace from disturbing the code)-Z String True if string length is zero [-Z $myvar]-N String if string length is nonzero, true [-N $myvar]string1 = string2 true if string1 is the same as string2 [$myvar = one o
Source:http://zhidao.baidu.com/question/322131711.htmlFile comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link [-l/usr/bin/grep]-R filename True if filename is readable [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/g
4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read usage:read[-ers][-a 数组][-d 分隔符][-i 缓冲区文字] [-n 读取字符数][-N 读取字符数][-p 提示符] [-t 超时][-u 文件描述符][名称 ...]5. Conditional discriminant Formula- eIs there a-nt (newer than) file1 is better than file2 new-ot (older than) file1 than file2 old-
description:Operator Description ExampleFile comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link [-l/usr/bin/grep]-R filename True if filename is readable [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/grep]Filename1
install Vnstat
9. Bwm-ngThe Bwm-ng (Next generation bandwidth monitor) is another very simple real-time Network load Monitoring tool that reports summary information and shows the transfer speed of different data to and from all available network interfaces on the system.
$ bwm-ng
Bwm-ng v0.6 (probing every 0.500s), press ' H ' for help
Input:/proc/net/dev type:rate
/iface Rx Tx T
ot===================================================
filename exists, true [-e/var/log/syslog]-d filename If filename is a directory, then true [-d/tmp/mydir]-F filename True if filename is a regular document [-f/usr/bin/grep]-L filename True if filename is a symbolic link [-l/usr/bin/grep]-r filename If filename is readable, true [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/grep]Filename1-nt filename2 if filename1 than filename2 new, then true [/tmp/insta
File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link [-l/usr/bin/grep]-R filename True if filename is readable [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/grep]Filename1-nt filename2 If filename1 is newer than
accessed.-O Returns True when the file or directory specified by pathname is present and is owned by the user specified by the active user ID of the current process.UNIX Shell comparison character notation:-eq equals-ne Not equal to-GT Greater than-lt less than-le less than or equal to-ge greater than or equal to-Z Empty string= Two characters equal! = Two characters unequal-N Non-empty string-------------------------------------------------------------------------A more detailed description:Op
: $J $ node After this operation was added $dep[v]*k-dep[j]*k=k* (Dep[j]-dep[v]) =k*dis[v,j]$And then prove that each node has the correct value.So just open another tree array to maintain the prefix $k$.The answer to the query is $sum (LS[V],C1)-sum (LS[V],C2) *dep[v]$1 //Minamoto2#include 3#include 4 #definell Long Long5 using namespacestd;6 #defineGetc () (p1==p2 (p2= (p1=buf) +fread (Buf,1,17 Charbuf[1 +],*p1=buf,*p2=buf;8InlineintRead () {9 #defineNum ch-' 0 'Ten CharChBOOLflag=0;in
R gsub Function
gsub()function replaces all matches of a string, if the parameter is a string vector, returns a string vector of the same Length and with the same attributes (after possible coercion to character). Elements of string vectors which is not substituted would be returned unchanged (including any declared encoding).Gsub (pattern, replacement, X, Ignore.case = False, Perl = False, fixed = false, Usebytes = False)• pattern : String to is matched• replacement : String for replacem
File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link [-l/usr/bin/grep]-R filename True if filename is readable [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/grep]Filename1-nt filename2 If filename1 is newer than
filename If filename is readable, true [-r/var/log/syslog]-W filename if filename is writable, true [-w/var/mytmp.txt]-X filename is true if filename is executable [-l/usr/bin/grep]Filename1-nt filename2 if filename1 than filename2 new, then true [/tmp/install/etc/services-nt/etc/services]Filename1-ot filename2 if filename1 than filename2 old, then true [/boot/bzimage-ot Arch/i386/boot/bzimage]String compa
install Vnstat
9. Bwm-ngThe Bwm-ng (Next generation bandwidth monitor) is another very simple real-time Network load Monitoring tool that reports summary information and shows the transfer speed of different data to and from all available network interfaces on the system.
$ bwm-ng
Bwm-ng v0.6 (probing every 0.500s), press ' H ' for help
Input:/proc/net/dev type:rate
/iface Rx Tx T
ot===================================================
-P option, it will not show the data of the link file, but the correct full path!
mkdir (Create new directory)
[[[emailprotected] ~]# mkdir [-mp] Directory name
Options and Parameters:
-M: Configuration file Permissions Oh! Direct configuration, do not need to look at the default permissions (umask) face ~
-P: help you directly to the desired directory (including the top level of the directory) to be created!
Example: Please try to create a few new director
Hmm's study notesHmm is a probabilistic model of time series, which describes stochastic generation of non-observable state random sequences by a hidden Markov chain, and then generates non-observable state random sequences from each state, and then generates an observational stochastic process from each state.A hmm consists of two states and three sets. They are the observed state sequence, hidden state sequence, transfer probability, initial probability and confusion matrix (observation value
[] args) {//create three different reference types required objects Reftestobj Softref = new Reftes Tobj (); Reftestobj weakRef = new Reftestobj (); Reftestobj phanref = new Reftestobj (); Softref.setid (1); Weakref.setid (2); Phanref.setid (3); referencequeueBy executing the refmainthread, we can clearly see the objects being queued in memory and the order and process of calling the Finalize method based on the printed results.In order to test different JVM environments and eliminate the
/etc/services]Filename1-ot filename2 is true if filename1 is older than filename2 [/boot/bzimage-ot Arch/i386/boot/bzimage]String comparison operators (note the use of quotes, which is a good way to prevent spaces from disrupting code)-Z String True if string length is zero [-Z $myvar]-N String True [-N $myvar] If string length is Non-zerostring1 = string2 true if string1 is the same as string2 [$myvar = on
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.