The essential point in programming is debugging, Shell script with its powerful function is desirable, of course, its powerful is not only embodied in the language of the implementation function, more powerful is its debugging function, below, I
Linux CentOS Shell display-bash-4.1$ does not display the user name path solution
Problem Description:
CentOS A new user, log in after the information of the shell script is as follows:
Rather than the combination of username@hostname we
The case name in the shell under Linux is similar to the switch in C + +, but the cases in the shell are more powerful and complex.
1, strong mainly reflected in: Shell in case the keyword can be a string type, and each item can contain regular
First of all, the CPU is a technical work, careless operation easily damage the CPU, please be cautious, the method introduced for reference only, we must be careful in dismantling.
How does the CPU shell take apart? To disassemble the CPU Shell
This is a Unix shell in DOS UNIX format under UNIX.
1, Single File
Dos2unix [Srcfile] > [targetfile]
eg.
Dos2unix Reporter.java > Reporter.java.back
dos2unix-437 Reporter.java Reporter.java
2, Batch File
#!/bin/sh
Filelist= ' Find. -name ' *.
As a participant in a large open source community, or rather as a member of the Fedora project, I have the opportunity to meet with many people and discuss various interesting technical topics.My favorite topic is "command line" or shell, because
grep-a digital search to show the next line of information650) this.width=650; "height=" 290 "src=" http://b176.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/
Summary of Common shell commandsThis article summarizes some of the common shell commands, hoping that Linux small white like me in the familiar with these commands, can basically cope with the small white phase encountered problems1.cdAfter the CD
Automatic deployment, initial configuration, and start of Nginx reverse proxy service, automatic deployment, initial configuration, and launch of two Web#!/bin/BashYum InstallEpel-release-yYum InstallNginx-yPSAux |grepNginx |grep-V'grep'if[$?-ne0 ]
Homework One: Organize your blog with awk, variables, operators, if multiple branchesJob Two: awk text processing1, print the UID within the scope of 30~40 user name[Email protected] ~]# awk-f: ' $3>=30 && $32. Print the line number and user name of
Write the Hello World script and execute the scriptTwo methods1, ls-a view all the files2. mkdir test.sh Create a file named test.sh3, CD test.sh into test.sh this file4, Vim test.sh open vim and enter into test.sh this file5, I (insert insertion,
===========================================================================if define a PATH variable in a statement the path that raised the command bug where path change occurs problem
Original script file: INotify +rsync Live Sharing
1.Linux default shell is bash,unix default shell is shBash is fully compatible with SH2. Define variables:When defining a variable, the variable name does not have a dollar sign ($), and a variable is used before the variable name plus $There can be
Like other languages, the Shell can also contain external scripts that merge the contents of the external script into the current script.The Shell contains scripts that can be used:
. FileName
Or
SOURCE filename
The
The shell supports custom variables.Defining variablesWhen defining a variable, the variable name does not have a dollar sign ($), such as:
VariableName="value"
Note that there can be no spaces between the variable name and the equals
The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is:While Commanddo Statement (s) to being executed if command is TruedoneThe command
Open a text editor, create a new file with the extension sh (sh for Shell), and the extension does not affect script execution.Enter some code:
#!/bin/bash
echo "Hello world!"
"#!" is a contract tag that tells the system what
The SED usage of LinuxSed is a good file processing tool, itself is a pipe command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work, the following first understand the use of
#!/bin/sh# back Tomcat Catalina. outCD/home/Log_bak #the filedate= ' Date'+%y%m%d-%h%m'' ARCHIVE=$DATE. Tar.gzfile="Tomcat_""$DATE. Catalina.out"#开始备份之前, write the backup information header to the journal file Echo" ">>Log.txtecho" ">>Log.txtecho"———
Before writing a shell script, you need to automatically create 1-100 of the text without knowing how to create it. Baidu finally know the way to create.There are a lot of ways to create 1-100 in a shell script, so I'll say two easy-to-understand
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