if logic judgment in shell scripts
Logical judgment Expression:
-GT (>); Greater than great than
-lt (
If logical judgment format:
Format 1:if condition; Then statement; Fi
format 2:if condition; then statement; Else statement; Fi
format 3:if ...; Elif ...; Then ...; else ...; Fi
--
can use | | Combine multiple conditions
a conditions b:a and b
conditions a| | Condition b:a or b
if [$a-gt 5] [$a-lt]; then
if [$b-gt 5] | | [$b-lt 3]; Then
Format 1:if condition; Then statement; Fi
#!/b
code paths are organized together, the chances are high that the method will work as expected. But this traditional approach does not work here, Resourcebreakdownservice is simply a "God class", and if I break this class with some understanding of the whole system, it is likely to cause many problems- In every nook and cranny of a legacy system, there may be many hidden secrets.
I wrote the following simple test, which reflects my understanding of t
, SkyDrive Network disk Baidu network disk, stable and long-term effective ~At the beginning of the document only with Notepad, obviously this is inconvenient and not practical, word is the same, with the editor to see the document always feel strange, of course, the most important is no bookmark function.Since the mobile phone has a reader, on the PC there is no reason not to find a few, found that it is necessary to use the Internet, and no longer like eread the technology monopoly, uncomfort
Tags: logical judgment file directory properties in shell scripts determine if special usage case judgment68. Logical judgment in shell script, file directory attribute judgment, if special usage, case judgmentI. Logical judgments in shell scriptsFormat 1:if condition; Then statement; FiFormat 2:if condition; Then statement; else statement; FiFormat 3:if ...; Then ...; Elif ...; Then ...; else ...; Fiif: If.Then: and then.-GT: Greater than.-LT: Less than.-eq: Equals.-ne: Not equal to. Noeq.-ge:
出当前负载值2. Monitoring Project 502.sh content#! /bin/bash# #获得一分钟前时间戳, in order to get 502 times in a minuteD= ' date-d '-1 min "+%h:%m"C_502= ' grep: $d: $log |grep ' 502 ' |wc-l 'If [$c _502-gt] [$send = = 1]; Thenecho "$addr $d 502 count is $c _502" ... /log/502.tmp/bin/bash. /mail/mail.sh $addr \_502 $c _502. /log/502.tmpFiecho "' Date +%t ' 502 $c _502"3. The monitoring item obtains the disk usage condition:disk.sh Content#! /bin/bash# #Writen by aming##Rm-f. /log/disk.tmpFor R in ' Df-h |awk
statement; Else statement; fiExample:[email protected] shell]# CP if1.sh if2.sh[Email protected] shell]# VI if2.sh#!/bin/bashA=1If [$a-GT 3]ThenEcho OKElseEcho NookFi[[Email protected] shell]# sh if2.sh//execution added the judgment of the Else statement, output NookNook[[email protected] shell]# sh-x if2.sh//-x can see the detailed execution of the script
A=1
' [' 1-gt 3 '] '//1 and 3 comparison is not greater than 3, the judgment is else
Echo NookNook
Format 3:if ... ;
Tags: put special usage Erro range Multi-select file properties passwd greater than OCALogical-judgment logical expressions in shell scripts are used in [] (brackets):
-lt:=little than less than
-le:=little wqual less than equals
-eq:=equal equals
-ne:=no Equal Not equal to
-gt:=greater than greater than
-ge:=greater equal greater than or equal
Used in (()) parentheses:
You need to enclose it in double brackets.Format One
if condition;
primary or extended partition, and the logical partition (which is based on the extended partition) number can only start at 5
Basic requirements for partitioning for Linux systems
at least one root (/) partition is required to store system files and programs. It is at least 5GB in size
to have a swap partition, which acts as virtual memory in Windows, the size of the swap partition is typically 1.5 times times the physical memory capacity (memory "but when the system physic
-1byte can be taken. For example, if you are 64GB of physical memory, it is advisable to 64*1024*1024*1024-1=68719476735Kernel.shmall = 4294967296 This parameter controls the total number of pages of shared memory that can be used. The size of the Linux Shared memory page is 4KB, and the size of the shared memory segment is an integer multiple of the shared memory page size. The maximum size of a shared memory segment is 16G, then the number of shared memory pages is
A new generation of WIN10 ultra-polar ASUS Zenbook 3 has now been opened in the United States market reservations, the latest ASUS Zenbook 3 redesign, the thickness of only 11.9mm, weight of 910 grams, the fuselage using aviation grade aluminum alloy, strength than ordinary notebook 50%, three color, They are the treasure blue, the rose gold and the quartz ash respectively.
ASUS Zenbook 3 carries the seventh generation Intel Core processor, is twice times the Apple MacBook Performance,
processors, 1GB (32-bit) or 2GB (64-bit) RAM, and at least 16GB hard disk space, so older PCs can also be easily upgraded. In addition, the system cannot run on RT and Windows N devices.
8, can not use System Restore restore the original system
If you have previously backed up the WINDOWS7 operating system to restore data, you cannot use it directly in the technical preview, you can only reinstall the system.
9, only support notebook and PC
The p
differs in that its hard drive capacity is upgraded from 256GB to 512GB, But the price is 1600 dollars higher. Personally, if your hard drive capacity requirements are not stringent, it is obvious that the lower version of a more cost-effective.
"15-inch MacBook pro" hardware Configuration/Price
This "15-inch MacBook pro" offers two different versions to choose from. " The Low-cost version of the sixth-generation Intel Core i7 processor (2.6GHz four core, support the core can be up to 3.5GHz)
Use the U disk's friends will know, U disk's actual capacity is often not up to its nominal capacity. But what is the reason? The following small series will be the actual case to analyze. Believe it, you will be able to understand the mysteries.
A period of time before the Internet to buy a 16GB of Kingston U disk authentic, received after the U disk inserted in the USB interface, Win7 automatic installation of the driver, installed after the U disk
. Note that Chromebook 2 is equipped with a Samsung Exynos 5 Octa processor with a battery life of up to 8 hours, but the performance is not very strong.
Acer Chromebook c720p
Reference price: About 1830 Yuan
Acer c720p is a newly listed new Chromebook, although the overall configuration and design and the previous difference is not small, but added touch screen design, you can better deal with touch-game operation. The other biggest advances are battery life improvements, a large
of 20k, its basic storage unit is a cluster, with two files, a 7k, a 1k. When the cluster size is 4k, the disk is divided into 5 clusters, two files Occupy 3 clusters, that is, the use of 12k, which wasted space is 4k, that is, the creation of internal fragments 4k. So we know that internal fragmentation is primarily a waste of disk space. Note that the fragmentation of Windows defragmentation is not the fragment, nor can it operate on the fragment, which is the fragment concept of external fra
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.