The most recent script always needs to be computed, and every time awk is cumbersome, it encapsulates the subtraction of awk, and each time the direct source math.sh is invoked.There are some points to be pointed out so as not to forget in future
Test the effect of prefetching, using the CPU to always view the effect. According to the experiment found that the prefetch address in the address before the use of the 10 lines around the code at the effect is better!
Copy Code code as
In the shell script, you find a problem with the case statement.This method of specifying lowercase letters [A-z] and uppercase letters [A-z] is no use.
The following conditions occur:
Copy Code code as follows:
[Root@station1 ~]#
Use syntax:chkconfig[--add][--del][--list][System Services] or Chkconfig[--level ][system Services][on/off/reset]
Chkconfig Displays the usage when no parameters are running. If you add a service name, check to see if the service is starting at the
1.CD-The function is to quickly switch to the previous directory , as follows:
Copy Code code as follows:
amosli@amosli-pc:~$ CD learn/fd/
amosli@amosli-pc:~/learn/fd$ CD-
/home/amosli
2.dirs: Display the directory stack,
A note earlier, just recorded two lines of code, put out the words is also a low quality page, so set up in order to only be visible, tonight to add.
Remember when the scene should be submitted sitemap when Baidu old hint of the wrong URL, cause
The daily analysis of the log of the brothers really can't afford to, often need to give pv,uv, independent IP and some statistics, use C/c++,java can write, the process is such, read the file, scan by line, put the value of the tag into the data
Basic knowledge
Shell execution Mode SH xx.sh (file must have R permission) | | ./xx.sh (file must have X permission) Note: Sh xx.sh method is more safeFileName suffix. shShell content Opening #!/bin/bash | | #!/bin/sh | | #!/bin/csh | | #!/bin/ksh
These days found that CentOS system memory has been up, even if the Apache and MySQL closed, memory is not released, you can use the following script to free memory:Script content:
Copy Code code as follows:
#! /bin/bash
# Cache
Script A (test example 1)
Copy Code code as follows:
#!/bin/bash
Echo ' Your are in the '
Q) Call another script file in the current script file?
Method One: Using sourceScript second (test example 2)
Copy Code code as
There are 3 main types of shell loops, for,while,untilThe Shell's branch judgment is mainly 2 kinds, if,case
A, for loop
Copy Code code as follows:
#!/bin/bash
For file in $ (ls/tmp/test/mytest |grep SH) The//for in format is
I. Single-select annotations
Lines that begin with "#" are comments that are ignored by the interpreter.
Copy Code code as follows:
#--------------------------------------------
# This is a script that automatically plays IPA,
Shell script:
#!/bin/sh # # # Convert file from GB2312 to UTF-8 # path= "$" unset opt if ["$" = "Force"]; Then opt= "-c-s" fi if [-Z "$path"]; Then echo "Nusage: $ n" elif [!-e "$path"]; Then echo "Nerror:destination: $path does not exist.n"
Nowadays many people like to use spaces when they are named, such as "an Introduction.doc". But this naming problem is confusing to Linux command-line tools and shells, because most commands use whitespace as a separator between values and values,
Renames the current directory's image file in a specific format, as follows:
Copy Code code as follows:
#!/bin/bash
#Filename: rename_photo.sh
Set-x
Count=1
For IMG in *.jpg *.png
Todo
new=image-$count. ${img##*.}
MV
You can now execute a command by using the Commandhelper.execute method, which implements the
Copy Code code as follows:
Package Javaapplication3;
Import Java.io.BufferedReader;
Import java.io.IOException;
Import
1: Script start line #!/bin/bash This line indicates that the script needs to run with the bash shell, regardless of the user's choice of the interactive shell. Because each shell's syntax is very different, this sentence is very important. 2:
CentOS 61-Key System optimized Shell scriptThe contents of the script are as follows:#!/bin/bash#author Suzezhi#this script is only for CentOS 6#check the OSPlatform= ' Uname-i 'if [$platform! = "x86_64"];thenecho "This script was only for 64bit
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