Classification ReferenceFile Status Test
-B filename
Returns True when filename exists and is a block file (returns 0)
-C filename
Returns True when filename exists and is a character file
-D
#一个shell的启动流程 #shell have some variables, called environment variables, which can be inherited, #比如父shell有 $UID, child shells can have, and inherit the parent shell. #正常我们声明一个变量, a=1, in the child shell, A is empty, and the variable declared by
[Email protected] wyb]#CatTest.SH Echo-E"\033[32mhello,this is Wangyuebo ' s shell\033[0m"Echo-E"\033[32m ' Date ' \033[0m"LANG=enEcho-E"\033[32m ' Date ' login at ' hostname ' W ' \033[0m">>/etc/Wangyuebo.log[[email protected] wyb]# when the cue is
View System available Shell types: (typically bash shell)? ~ Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/Dash/bin/zshTo modify the current shell:[[email protected] ~]# Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/Dash /bin/~ for root. New Shell [/bin/bash]:/
Reprint please indicate http://www.cnblogs.com/winifred-tang94/There are three types of variables in the shell environment:A, environment variables; You can refer directly to the shell script in the form of "environment variable name".b,
Shell variables: Local variables and environment variablesBasic elements:#! /bin/bash#VariableProcess ControlHome: The current user's home directoryPath: The current user's executable file search pathLANG: The default language the program should
Zookeeper under the shell operationEnter%zk_home%/binperform zkcli.sh [-server Ip:port] #如不指定, then connect the nativeCreate:create [-S] [-e] path data ACL #创建数据节点-----s indicates that the sequential node-e represents a temporary node, and two are
character class (Character Class): The above example x and y, which represent one character in the pattern , but the range of values is a class of wordsAny one of them.Quantity Qualifier (quantifier): each part of a mail address can have one or
Eval syntaxEval arg1 arg2 ...The function of Eval is to take the following parameters Arg1 Arg2 and so on as a pipeline, and then re-execute the shell process pipeline (about pipeline, see http://www.cnblogs.com/chaoguo1234 /p/5724321.html)Suppose
Create two scripts in the system bin directory, respectively, Pssh tsshPssh#!/usr/bin/expect-fSet IP [lindex$argv 0]set Port [lindex$argv 1]set Password [lindex$argv 2]set TimeoutTenspawn ssh [email protected]$ip-P$portExpect {"*yes/no"{Send "yes\r";
Script Programming:Sequential structureSelect structureIfCaseLoop structureForWhileUntilWhile loop: For scenarios where the number of cycles is unknown, exit conditions are neededGrammar:While CONDITION; DoStatement...Done Calculates the and of all
Shell Footstep Source code:[Email protected]_ecs imooc_shell]$ lscheck_http_log.sh check_nginxserver.sh master_control.sh system_info.shMaster_control.sh: The main control footsteps, other footsteps this script calls##################################
Special usage One whileSyntax Formatwhile read line; DoLoop bodyDone Function: Reads each row in the/path/from/soemfile file sequentially and assigns this line to the line variableExample: Scan a/etc/passwd file for each row, if the Discovery gecos
There are two ways of doing this:1, with TRExample: uppercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE lowercase to uppercase)lowercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE uppercase to lowercase)2, with
Overview:Statement control for Shell scripts-There are three processes in the process programming language mentioned earlier:Sequential execution: Executed in the order of a single statement;Select execution: Select execution according to the
• printenv– Print Some or all of the environment variables• set– set shell options• export-Export the environment variables so that the program that is executed later knows.• alias– create command aliases1.shell Environment: The shell maintains a
Exercise one: Write a script 1. Set the value of the variable file to/etc/passwd 2. Say hello to each user in/etc/passwd, and say what the ID is like: (Hint: line= ' wc-l/etc/passwd | Cut-d ""-f1 ') Hello,root,your UID is 0. 3. Count the
The difference between an array and a variableVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray = array name + indexIndex:
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