ObjectiveToday, when writing a script, found that the previous phase used some of the usage is still need to go to Baidu Search, and find the answer also need to filter, delay writing script time, this article on the comparison between the string
1, there are two records in the logID Start time End time0dedffee485e7ddbbff1236cfc0d91 2018-06-28 16:55:37 2018-06-28 16:55:52122dw049dc21b0a7dcdfegeat8c8 2018-06-28 17:21:01 2018-06-28 17:21:23How can I use the Linux shell command to calculate the
Shell Basics1.shell is the intermediate medium used when the system interacts with the computer hardware, and he is a system tool. If the computer hardware analogy to the human "body", the system kernel is the human "brain", the shell is the "five
1. basic usage of shell variables and usage of common symbolsThis section requires writing out the shell commands that implement the requirements , showing(1) Change the main prompt to the user's home directory name( Hint: reference material 4.6.8
1 Querying work status through the Web monitoring page of HBase discover the regions in transition area has a long-running task, you need to close Hbase-master and restart, and then this problem process I directly use/etc/init.d/ Hbase-master restar
Shell Script Learning (i)A) Introduction to code-style shell scripts 1. Download Xshell 5 Build a folder Mkdri Home/data;1) Look at a 1.sh built in data See if the build was successful.2) and edit echo Hello Word, and save the launch
Implementing a certain bit of a register with a shell scriptPit bit 1:Not recognized on the Development Board (Ubuntu can)For ((i=0;iDoDoneInto:For i in ' seq 0 6 'DoDonePit bit 2:return value by default only 8 bits are truncated.Setbits $ $4Regv=$?
#!/bin/bashWhile:Doecho "1. View CPU
View Memory
View Disk
View IP
Exit
Read-p "Please select menu:" ItemIf [${item}-eq 1]; Thenecho "CPU operating frequency is as follows:"Cat/proc/cpuinfo | grep MHRead-p "Enter carriage
Shell wildcard characters# notice is completely different from regular, similar to regular * any of at least one character ? Any one character [ ] [] any one of the characters, the relevant character set a-Z 0-9Shell redirection# re-designation of
Create a script admin.shPerform the following functions:-H | --HELP: Providing Help information--add users: Completing user additions-del User | --delete: Complete User deletion-V: Turn on debug mode, display informationYou can use all of the above
read:Brief introduction:The read command reads the value of a variable from the keyboard and is typically used in a shell script to interact with the user. The command can read the values of multiple variables at once, and the variables and input
1, SH and./The Difference[email protected] ~]# cat test.shEcho I am thzzc1994[Email protected] ~]# sh test.shI am thzzc1994[Email protected] ~]# bash test.shI am thzzc1994[Email protected] ~]#./test.sh-bash:./test.sh: Insufficient permissionsWant to
Function Description: Cleans the Messages history log file (Messages-date) under the/var/log/path, but does not clean the messages file itselfDependency requirements: The BC module is installed on the server1 #clean_logs.sh2 #!/bin/bash3 4 # ========
Odd number of LikesLife is not as good as the ten, but there are no two or three people with the prophets. Fortunately, we were born in the internet era, the reality can not find to talk to people can also be found in the network of emotional vent,
Recently in the shell script, found some shell strings of the Sao operation, can improve efficiency.String Read
${var}: Value of variable var
${var-default}: If Var is not declared, the value of Var is $default
${var:-default}: If
Array:Variables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray name and IndexIndex: Numbering starting from 0, which is a numeric
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