1, the variables in the shell can be customized, the shell uses the variable with the $Name= "Shero"echo "Hi ${name}"[Email protected]:/home/shero/shell#./test2.shHi SheroNote that there can be no spaces between the variable name and the equals sign,
Today, a colleague is writing a database backup shell script, in the case of several times to determine the script code is correct, found that the results of the script output is not normal./* * * @author Jenkihuang * @email [email protected] *
Reference "Bird's private cuisine--linux Basic Study (third edition)".In "bird Brother's private cuisine--linux Basic Study (third edition)" in the 11th chapter, bird Brother about the variables of the test and the content of the replacement, the
"Shell Script Basics"Create a script#vim 1.sh*********************#! /bin/bashecho "Hello world!"*********************#chmod +x 1.sh#sh 1.shHello world!Extensions and command extensions still work within double quotation marks.#echo "Can I have a
#!/bin/bashwhile ifs=: Read name1 name2 name3 name4#ifs is the split symbol specified when reading from a file, assigning the contents of a to the corresponding variable in separate sections. Do echo $name 1 ' | ' $name 2 ' | ' $name 3 ' | ' $name 4
When writing the shell script to find that the CD switch directory can not switch, the code is the following.1 #!/bin/bash2#changedir. SH3history4 cd/home/ Firefox516 pwdI think carefully, I carry out the time is. Changedir.sh to execute, so that
The shell, as a scripting language, is a skill that every Linux administrator must master, sometimes adding some background color to the output in the shell, making the script a little more aesthetically pleasing, and using echo to output a string,
Well, that's how it started.First of all, this little episode ... It was written, it collapsed, and then I collapsed ... Crash I looked everywhere for a tool that would not let me collapse, and then find out to find the ScribeFire.1. Take parameters
A simple paragraph was written in the shell.Energy.sh content:#!/bin/Bashhost=127.0.0.1User=******passwd=******dbname=******TableName=Device_value_300sct007p01_yearmonth=$(Date+%y-%m) sqlstr="INSERT INTO Device_value_300sct007p01_year (id,year,month,
1. Read the value of the Jdbc_url parameter in the configuration file ($InputParamFile the absolute path of the destination file to be read)Jdbc_url= ' grep ' Jdbc_url ' $InputParamFile | Awk-f ' = ' {print $} '2. Modify the value of the
#!/bin/sh notifications are explained by bash. If you execute the shell command date in the Echo statement, you need to precede the date command with the symbol &;You cannot execute the file immediately after editing the file, and you need to set
We communicate the commands we enter with the kernel through the shell so that the kernel can control the hardware to work correctlyBash is our default shell for LinuxUser interface (Shell,application)--------core (Kernel)-------hardware
This study: Understanding the shell, how to write shell scripts and executeThe shell is actually a program that interprets the execution of commands,The so-called shell programming is to use a certain syntax to combine the various basic commands,
Sort is used for sorting, and the uniq is used to de-weigh, and these two commands are often used together. Mainly because the Uniq to the premise that the text must be arranged in order to be.Of course, it is true that these two commands are indeed
1. Issues to solveWhen you need to enter a number of commands at once , such as deleting files in multiple directories at onceCD Dir1RM file1.tempCd.. /.. /dir2RM-RF Dir3When you are too lazy to enter a good long command or simply can't remember
To see what versions of the Shell:cat/etc/shells system are currently running, the first process that starts is initHow bash Shell debugs:Simply add parameters after the SH command-N: Do not execute scripts, query the grammar within the scripts, if
Loading the shell process through process 2, in detail execve, this article, the last shell program to start executing the linear address is 128MB, due to Free_page_tables, has released the 32nd-bit page directory entry. Therefore, a fault is
Numerical calculation of ①shell$[[space] $a [space]operator[space] $b [space]]The calculation operator and its operands must be enclosed in square brackets [], followed by $ as a leader, and [space] means that spaces are dispensable here.Eg: ' A=2;b=
3. Variable DeclarationReadOnly Read OnlyExport Modify or print environment variablesexport-p Show Current EnvironmentNote : It is important to note that there must be no space before and after the assignment. # Echo Control character color [email
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