By using the Read command, you can output or perform operations after entering content from the terminal1 #!/bin/bash2#Author: Blacksonny3#Copyright (c)4 #Script follows here: 5 6 Echo " How is old is you ? " 7 Read Age 8 Echo " " $ageThe above
ReferenceCase , If I want to output an asterisk (*), How do i use echo ?echo *This is certainly not possible , need to transfer the * , that is : Echo \*This leads to the concept of references . referenced by , is used to prevent Shell to interpret
Method One: Add debugging options when you run the script:"Usage" bash– option./shellscript.sh-e: If a command returns a non-0 exit status value (failed), exit.-N: You do not need to execute the script just to check the syntax structure and return
Start your own shell script practice today, just as the company has too servers, to time the data of the CP is monthly:Consider: First look for the law, found all placed in the/opt/www/aaa/there are a lot of 2 level and 3 levels of directories and
While Loop :Description: The while loop is an indeterminate loop, also known as a conditional loop. As long as the condition is judged, the loop will continue to execute until the condition is judged, and the loop will stop, which is not the same as
Syntax for the FOR loop:1. For variable in value 1 value 2 value 3 ....DoProgramDoneFor example: The following script will print 4 times respectively the value of morning noon afternoon evening1 #!/bin/bash2#打印时间 3#Author mrfeng45 for-time in
1) Judgment expressionIfTest (expression is true)IfTest! expression is FalseTest expression 1–a expression 22 expressions are trueTest expression 1–o Expression 22 expressions have a true2) Judging the stringTest–n string string is not zero in
Typically, when you write a shell script, you'll find that the same piece of code is used in multiple places. It doesn't matter if it's just a small piece of code. But it's hard to rewrite chunks of code multiple times in a shell script. The bash
Need to deploy the server itself, so after the application of space, you need to install Linux itself, install Apache, etc., so download the compressed file needs to run. On the internet to find some decompression command wrong, especially try the
#!/bin/bash### #定义screen的名字, the following installation will use screen this command screen_name= "LANMP" #根据 $UID to determine whether the user is root, must root to perform if [ $UID != 0 ]; then echo "You must be root to
First look at the help command for hive:[[email protected] hive]$ hive-hmissing argument for option:husage:hive-d,--define Va Riable subsitution to the Apply to hive commands. e.g.-D a=b or--define a=b--database Specify the database to Use-e SQL
$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the Case of "" ", in the
The mountain is the essence of the package insert sort sort. This method is also known as a narrow incremental sort because of DL. Shell to 1959 named.The basic idea of this method is to first cut the whole sequence of elements into several
Linux Shell expressions and linuxshell expressions
Strictly speaking, shell does not have the expression concept. Shell itself is actually a collection of a bunch of commands. Of course it is not just a collection of random together, but a certain
Solution for shell not displaying the user name path in CentOS
In CentOS, shell-bash-4.1 $ solution to not display the user name path
Problem description:
Add a new user under CentOS. After logging in, the shell script information is as follows:
SHELL script-1, shell-1
.: Represents any character
*: Matches the preceding character. a * Indicates zero or multiple.
+: Match with the previous character to indicate one or more previous characters.
? : Matches with the previous character to
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