In Shell learning, we encounter these two symbols: anti-quote (') and $ (), what are the differences between them?We all know that in bash, anti-quotes and $ () are used for command substitution, and command substitution is used to reorganize the
Generally as long as the Linux installation of the Chinese language pack, you can use English as the default character encoding, you can also recognize Chinese characters, garbled can modify the character encoding settings,Method One: Modify the
Shell variables${#var} to calculate the length of the variable value:1. Definition of variablesVariable name = "Content assigned to Variable" (string)Variable name = ' assignment to the contents of a variable ' (string)Variable name = numeric value (
Today's mood is not very beautiful, play jokes may not be so much, or return to the point1. Specify the SSH port, user name, password-related configuration, I do not need to configure the key here what.2. Next time you create a task, SSH
The content of this section:Shell string Interception method1, remove the leftmost character of the string[[Email protected] ~]$ VI test.sh1Str="ABCD" 2str=${str#"a"} 3Echo $STR4str=${str%"D"}
There was a time when the shell was not written, and today I occasionally see a shell file content. There are some special usage, only feel the impression but can not say the specific function, and then checked. By the way record down, prepare for
1.1 Shell some small summary1, 0 wide assertion 2, Print menu 3, getopts option Introduction 4, script query IP geolocation1.1.1 grep zero-width Assertions (0 wide assertion)It means taking out what you want and getting rid of things you don't care
1. Create 10 files in the/test directory using a For loop such as: Test-1,test-2,... test-10mkdirsh.sh#!/bin/bashFor i in ' seq 10 'Do[!-d/test] && mkdir-p/testtouch/test/test-$iDonechmod +x mkdirsh.sh2, in the/test directory to quickly create 10
First, the logical operator
Logical Volume Label
Express meaning
1.
About the file and directory of the detection of Logical volume label!
-F
Common! Detect if "Archive" exists eg:if [-f
The shell supports custom variables.Defining variablesWhen defining a variable, the variable name does not have a dollar sign ($), such as:Value= "TMP"Note that there can be no spaces between the variable name and the equals sign, which may be
if [$#! = 1]; Thenecho "USAGE: $ tabname"echo "e.g.: $ cdr_call_20040701"Exit 1;FiLocation parameters $ #代表了命令行的参数数量, $ $,..., $N, and $ A represents the name of the script-ne Not equal to-----------------------Used in shell programming to determine
Shell tip:1. Need to add ' $ ' when referencing variables2.shell variable viewing and deletionSet | grep variable name//view Set Variable unset variable name//delete variableThe difference between single and double quotes in 3.shell650) this.width=65
We often need to generate ActiveXObject ("Wscript.Shell") to tune an EXE file,Such asSet page header footer to print is emptyvar Hkey_root,hkey_path,hkey_key;Hkey_root= "HKEY_CURRENT_USER";Hkey_path= "//software//microsoft//internet
The first time to write a blog, add some nonsense, learning Linux for a period of time, with the study of the deep discovery of their lack of learning system, especially encountered some inexplicable problems, I only have a variety of Baidu, good
In the execution of the scheduled task copy file, the SCP command needs to enter the password, where the public key to implement the automatic password input.Specific operation:Requirements: Copy the Test.tar on the 192.168.0.2 machine to the 192.168
The main purpose of HDFS design is to handle massive amounts of data, which means that it can store a large number of files (terabytes of files). HDFs divides these files and stores them on different Datanode, and HDFs provides two kinds of data
Compiling Java projects is generally straightforward with the IDE or with tools such as Ant and Maven, and few people use pure shells to compile Java projects. Just meet such a should, use this blog post to make a record.Case: I wrote a Java project
Specify an array for a characterHow to display an arrayA=1echo $a1A= (1234) echo $a1echo ${a[@]} 1 2 3 4echo ${a[*]}1234Specifies the number of digits in the display arrayecho ${a[0]}1echo ${a[2]}3echo ${a[3]}4Echo ${a[4]} spacesAdd arraya[4]=9echo $
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