Preface
Linux Shell Scripting Basics We are almost finished here, function believe that we are not unfamiliar with it, directly to the topic of it ~
Please indicate the original link:http://blog.csdn.net/u011974987/article/details/52718164This
one echo command output text
1.1 displaying normal strings
echo [Options] string
option means that the command option, only-n, does not output a newline character at the end of the line.
If the text you want to output is made up of multiple
Note: The example of this article comes from the collection and collation of the network, with my comments attached. Common uses of ①i/o redirection
Symbolic meaning
cmd1 | cmd2 pipe character, the standard output of CMD1 as the
Original: http://apps.hi.baidu.com/share/detail/31263915
Comparison of strings and values in the shell
In the shell, the comparison between the string and the numerical method is different, pay attention to distinguish
Integer comparison:
-eq
I would like to have a person who is as ordinary as youLike a refreshing breeze in the mountainssuch as the warm light of the old CityFrom early morning to nightFrom the wild to the studyAs long as you're the lastJust fine.
--Zhang Jiajia "Passing
I. Logical judgments in shell scriptsGrammar1. Format 1if condition; Then statement; FiExample: If a is greater than 3, print OK[[email protected] ~]# vi 2.sh[[email protected] ~]# bash -v 2.sh #!/bin/basha=5if [ $a -gt 3 ]then 2. Format 2if
The Shell, like other programming languages, supports a variety of operators, including:Arithmetic operatorsRelational operatorsBoolean operatorString operatorsFile Test OperatorsNative bash does not support simple math operations, but can be
The use of Springboard machine only to do SSH relay, in order to strictly control the data entry and exit of the Springboard, command management, special access to the springboard operation to restrict management. The script contains two interface
>Access to variables: EchoEcho $variableEcho $PATHEcho ${path}Configuration rules for variables1. Variables and variable contents are linked by an equal sign "=" as follows:"Myname=vbird"2. The equal sign cannot be directly connected to the space
I. Introduction of IFSThe Shell script has a variable called IFS (Internal field Seprator), the internal domain delimiter. The full definition is the shell uses the value stored in IFS, which are the space, tab, and newline characters by default, to
$ CD ' DirName $ ' and pwd%} display the current directory name${#var} to be replaced by the number of variable charactersSpecial variables$ current Shell's PID? Exit status of the previous command! PID of the previous work performed in the
Reference: Signal processing practice in shell scripts the signal trap function of the Linux shell you must know the details in Unix, each type of event that can occur is described by an independent signal, each of which is a small positive integer,
1. Download Peanut Shell 2. Find the Linux version to download3. Installation, the new version of the Linux version is in the form of SN code4. This is the start command of the peanut shell relatedNote: If you use the previous version, if you use
Variable substation and global variables in the shellBash's variables are global variables by default, and can be called within a script, regardless of where (and in the body of the function), a variable in the function body can be called outside
Iv. conclusion of the experiment1. Practice command history, aliases, and special character usages in the shell (4th. 4.2, Section ~4.5)2. Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help
Description: The shell parameter, as the name implies, is passed to the shell script, we can use some parameters in the sh scripts.sh parameter parameter +1 parameter +2 of the way to execute.The format for getting parameters within a script is: $n
For statement1. For statement1) IntroductionIn the actual work, often encounter a task to be executed multiple times. Each execution is simply a different object, with the same other commands. For example, create a system account based on the list
#!/bin/bash# Remove site Data web= ' cat website.txt ' if [-Z ' $web '];then #判断长度如果为0 true. No need to test Web site echo "Data that's not tested" exit 1fitest-f result.log && rm-f result.log #test-F if it's a normal file then true Functi On delay {
Shell ArrayBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the
Configuration files for pipeline operators, Job control, shell variables, global variables, environment variables, and shell global variables
Pipeline operator
Pipe character "|": Use the output of the previous command as the input of the next
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.