Article from: http://blog.sina.com.cn/s/blog_77051ec50101br8g.html
It is often necessary to do some delay processing in Linux shell scripts.So you often use sleep or usleep functions.Here's a look at the difference between sleep and usleep:
Sleep:
@WHILE Loop Statement @
V1=1
While ["$v 1"-lt "6"] #注 [and] have spaces around them,-lt have spaces before and after them.
Todo
echo "This is the $v 1 ' showing up"
v1=$ (($v 1+1)) #注意 $ (()) is a mathematical formula
Done
@FOR Loop Statement @
For
Basis
Spark's shell serves as a powerful interactive data analysis tool, providing an easy way to learn the API. It can use Scala (a good way to run an existing Java library on a Java Virtual machine) or Python. Start running in the Spark directory
The principle of 0x00 broken shell loophole
Enter the inside of bash
~ Export Name= ' () {echo ' Inside name ';}; echo "Outside name";
View environment variables
~ Env|grep name
~ name= () {echo ' Inside name ';}; Echo ' outside name ';
At this
Seven types of files
D Directory L Symbolic link
s socket file B block device file
C-character device file p named pipe file
-Regular file regular expressions
When you extract or filter text from a file or command output. Regular Expressions (RE)
When writing a shell script, the first line to add: #!/bin/bash, because Linux is not only bash a parser, there are other, they have some differences between the syntax, so it is best to add this sentence, tell the system to use this parser.One.
Conclusion:By default, the variables for the parent shell and child shell are isolated.SH mode to run the script, it will re-open a child shell, unable to inherit the normal variables of the parent process, can inherit the parent process export
$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the fifth chapter, which is used to reorganize the command
Shell problem Summary, this series is I as a rookie in the process of solving problems to solve the process, I hope to record down to the new scholar help.requirement : To resolve whether a file exists on the remote server1, judge whether a file
Function: Quickly and automatically generate keys and bulk push to remote host, suitable for batch push key for ansible environment#!/bin/bashkeypath=/root/.sshiplist=/root/ip.txt[[ -e ${iplist} ]] && > ${iplist}for i in `seq 81 91`do echo -E "192.
1. Architecture 2. Front 2.1 Free QuestionsThe public key confirmation prompt pops up when the server is first connected. Causes an automated task to be interrupted due to the initial connection to the server.The stricthostkeychecking configuration
Tag: equals $? Additional command redefine the txt dir bin integer$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.# echo ' which who '# echo $ (which who)/usr/bin/whoThey're getting the same results.
"If syntax test condition judgment Statement" go from: http://lovelace.blog.51cto.com/1028430/1211353 "while for Loop" go from: 78681117for variable in list do Command1 Command2. Commandndone can also be written as: for Var in list; Do read the
Native Computer Win10python3.5 is installed1. Run pip install Ipython[all] directly on the command line IpythonAfter installation is completeEnter Jupyter notebook on the command line to see the Ipython notebook interface in the browser2. Then set
Use filezilla and SSH Secure Shell client to upload and download files on Ubuntu through SSH
L use filezilla
First, start the SSH service on Ubuntu.
Sudo/etc/init. d/ssh restart
Start filezilla on Windows:
For example, if the
To test the comparison of integer types in shell programming, the following test code is specially written:
#! /Bin/sh # adding single quotation marks to variable values in shell. The difference between double quotation marks and double quotation
From: http://wowubuntu.com/linux_shell_1.html
The best Linux Shell Command series serialization (1)
9th2010
# Author: Riku/This article uses CC BY-NC-SA 2.5 protocol authorization, reprint please note this article link.
NOTE: With the consent of
1. Variable type in Shell
Shell variables can be divided into environment variables, location variables, pre-defined special variables, User-Defined variables,
Environment variables in shell are shell predefined variables used to set the system
#! /Bin/shFiles = ""Trcase = ""EXT = ""Opt = No
# Gets called when a conversion failsError_msg (){_ Filename = $1Echo "'basename $ 0': Error The Conversion failed on $ _ filename"}
If [$ #-EQ 0]ThenEcho "for more info try 'basename $ 0' -- help"Exit
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.