1. Export Env_var=value #修改环境变量2. Env #查看环境变量值3. Hostname #显示主机名4. readlink-f filename #文件的完整路径5. Tar xzf filename.tar.gz; #解压, followed by the-C dirname, means to extract to a directory.6. Tar czf filename.tar.gz dirname #压缩7. Ctr+r use keywords to
[Email protected] wyb]#CatZhuijiu.SH #!/bin/bash#1, write a script execution, enter a name, generate a random number 01-the number between 99. #2, if the same name repeated input, the captured number is the result of the first crawl, #3, the number
Requires the target machine to have the expect command installedDivided into five files config.ini (config file), id_ras.pub (public key), read.sh (a function for reading the configuration file), test.sh (execution file), run.sh (remote run script)
1. Batch add user's small script:1 for inch XP WRG LCT 2 Do 3 Useradd $name 4 Echo passwd --stdin $name5 DoneTo echo Red | Explanation of the passwd--stdin $name:First, the commands before and after the pipeline are not sequential. PASSWD is
[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
1. What is a shell?The shell is in the outer layer of the kernel, which is responsible for receiving commands entered by the user, interprets the commands as kernel can understand, then executes by kernel and returns the results back to the default
1.-bash:./dd.sh:/bin/bash^m:bad Interpreter: No file or directoryWhen the above problem arises, first look at your. Profile is configured correctly, the general configuration is: path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbinNote The general
When we use the Xshell development machine, we often encounter some problems, such as the use of certain commands he will command not found, the reason is that we have to configure the environment variable, so that can be accessed in any path.This
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
Basic steps:1. Switch to the warehouse directory Rpm_list_dir1 and RPM_LIST_DIR22. LS lists the RPM package files of the warehouse and redirects them to the output files Rpm_list_file1 and Rpm_list_file2 respectively.3. Output the comparison results
Problem: There are 600 IPs in the ip.lt file, 3 document templates, and three document name structures are "ip+ series of Strings", Requirements: 1. Divide 600 IPs into 3 points, create 600 documents based on three templates, same name structure as
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
• 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
1, single parenthesis and double parenthesisThe double parenthesis command allows advanced mathematical expressions to be put into a comparison. The format is as follows:((expression))In addition to the standard mathematical operators used by the
How to handle the programming logic:1, sequential execution2, select Execute3, loop executionConditional Select if statementSelect Execute:Note: If statements can be nestedSingle Branchif judgment condition; thenBranch code with true
Shell scripts are extremely important in operations, and the use of arrays in shell scripts is a very useful aspect in both looping and computing.Here are some operations on the array aspects of the shell script to record here, hoping to help
Want to test the Elasticsearch operation of cluster mode in Spark-shell,# 1 Download the relevant jar first# 2 Use--jars when starting Spark-shell./bin/spark-shell–master Spark://master:7077–jars/usr/local/spark-1.6.2/lib/elasticsearch-spark_2.10-2.2
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.