Shell Learning Notes (1)-Variables

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,

Ubuntu Shell Scripting Coding issues

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] *

Testing and content substitution for shell variables

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 Basics Exercises

"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

Shell Summary (while)

#!/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

The use of the CD command in the shell script

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

Shell Tips--color output

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,

Open a post and start learning shell programming

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

Shell error ' @ ' localhost ' (using password:yes) ' root '

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,

Shell Common operations

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

Shell program Exercises

#!/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

Know bash, the shell.

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

Writing shell scripts and executing

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,

6 Sort,uniq of the shell command

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

Scripting Shortcuts: A tool for simplifying shell Terminal command input

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

Shell Scripting Learning

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

Understanding fault pages by starting execution of shell processes

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

Let the echo output in the shell script color

Http://www.linuxidc.com/Linux/2014-12/110463.htm#!/bin/bash#定义颜色的变量Red_color= ' \e[1;31m ' #红Green_color= ' \e[1;32m ' #绿Yelow_color= ' \e[1;33m ' #黄Blue_color= ' \e[1;34m ' #蓝pink= ' \e[1;35m ' #粉红res= ' \e[0m '#需要使用echo-EEcho-e

Syntax knowledge for shell Scripts 2

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=

Shell Step by Step (2)--variable

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

Total Pages: 541 1 .... 334 335 336 337 338 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.