When writing a script (Shell), you will often encounter the path name, file name, and so on in the filename including the full path.
This includes a full path file named
/usr/local/apach2/etc/httpd.conf
Defined as
File=
Shell Getting Started Tutorial: Shell variables
Variable
A variable is a place to store data temporarily, and is a memory space. Bash shell and other programming languages, there is no "data form", which means that the default is not to
Copy Code code as follows:
Examples of string operations in work
Filename= '/home/admin/jobs/cnclickstat/dfsloader/loader.cfg '
#下面是使用shell字符串操作
buname1=${filename#*/jobs/} #去除 '/home/admin/jobs/cnclickstat/dfsloader/loader.cfg '
In Unix-like systems, symbolic links are common and we encounter a variety of processing work related to symbolic links.This article for you to introduce some of the practice of symbolic links, I hope to write a shell script to bring some help, the
Example of a bash case statement.
Sharing a bash shell code is helpful in understanding the use of case statements by students who learn about bash.
Example:
Copy Code code as follows:
#!/bin/bash
##
# program:
# File
This is a shell script, so first you need to install a basic Cygwin environment and, of course, curl.
The principle is very simple, first download the latest MIRRORS.LST mirror list from cygwin.com, after simple processing, using curl to detect the
I. Introduction to the ConceptNetwork programs are divided into server-side programs and client programs. The service side is the one that provides the service, and the client is the party requesting the service. But the reality is that some
This is my moves to write bash programs. There's nothing new here, but from my experience people love to abuse bash. They ignore computer science and create "big clay balls" from their programs: software systems that are not clearly structured.
Linux compares the differences of 2 files with two commands:
(1)diff (2)Vimdiff
cp/etc/grub.conf Hello
Add Zhangsan at the end of the hello file
Use diff to compare the differences between 2 files:
[Root@rhel ~]# diff hello/etc/grub.conf
18d17
8.10 Shell Special Character _cut command* Any of any characters? Any one character#注释符号\ de-Justification symbol| pipe character"$" the symbol with "!" "!$" means the last variable in the previous command";" Delimiter, use "~" User's home directory
Sometimes it is necessary to calculate the execution time of the command, which can be used, although the time command can be accurate to the millisecond level, but it is not possible to calculate the execution times of a heap of commands. You can
Jenkins Automation Deployment Goal: Jenkins on point build (also automatically check code changes automatically build) "Project deployment complete." First, install the jenkins1. Download JenkinsHere I choose is the war package installs Jenkins,
1. Set the environment variable histsize so that it can save 10,000 command history.Vim/etc/profile changed histsize=1000 to histsize=100002. Why does setting PS1 (ps1= "[\[email protected]\h \w]\$") show a different result than we expected, and how
From:http://www.cnblogs.com/aaronwxb/archive/2011/08/19/2145364.htmlWriting a script yesterday took 2/3 of the day, and most of the time spent on the SED command, today do not summarize the time of yesterday, I'm sorry.There are several commands for
Hello everyoneThis is a self-reading, learning shell programming, the work of a large number of applications, especially awk, SED, grep-based. Hope to be useful to everyoneYou can see the central location directly."Data"Export
Guide
When you're going to really manipulate your Linux system, there's nothing like a command-line interface that lets you do that. To be a Linux master, you must be able to understand the different types of shell commands and use them
[Email protected] wyb]#CatTishiuser.SH #!/bin/Bash #提示用户输入一个用户名, if present, displays user UID and shell information, otherwise, #则显示无此用户, prompts the user to enter again after the display is completed, and exits if quit ;Echo 'Input ' quit ' to
Outline: 1. Logical Judgment 2. If flow control statement 3. For loop control statement ---------------------------------------------- Before you begin, let's look at the logical judgment symbol: && and,| | Or,! Non - A && B must be set up at the
Reprint please indicate http://www.cnblogs.com/winifred-tang94/To create a shell script, start by creating a new text file, and then enter the shell command in the text file according to the Shell programming rules.There are two ways to run a shell
The meaning of several variables in a common shell with a $ symbol:Difference:@">@ *
Same point: All parameters are referenced
Different points: only in double quotes. Suppose that three parameters were written when the script was run (stored
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