1. "Type" detection of a file name (presence or absence), such as TEST-E filename-E Does the "file name" exist? Common-F is the "file name" an archive (file)? Common-D is the "file name" directory? Common-B is the "file name" a block device
IntroductionShell, we often use, with its powerful features, will help us solve a lot of difficult problems. Recently encountered a problem, to run a lot of case, assuming that the serial execution, it takes a long time. Can we get them to go
In the Linux production environment, there are the following such a common operations need to work.Every once in a while, such as two hours, the log file to generate the log per second (this is assumed to be testfile.out, the absolute path
At present, more and more enterprise applications are deployed on Linux systems, and Linux Shell scripts can greatly help us to perform operational tasks for these applications. This makes the Linux Shell development skills an important and
Today, the company LD asked to write a small script to monitor whether a process exists and how to exit the script. If it does not exist, send an email to the specified mailbox, I use the running status of the daemon to determine the connection
In the previous basic Linux Shell script study, we talked about if, select, and Case of the process in the Linux Shell script. Here we will introduce the loop and quotation marks of the Linux Shell script control process, the control process
From: http://www.cnbeta.com/modules.php? Name = News & file = article & SID = 5313
This is definitely a software that will surprise 100% of Gmail users.This 100 k software will generate a virtual hard disk partition Gmail drive on your hard disk,
Use 'grep' to search for text files
If you want to find a string in several text files, you can use the 'grep' command. 'Grep' searches for the specified string in the text. For example, if you are searching for a file with the string 'Magic 'in the'
Developed on the Linux platform, another script file is often executed on the console. The following methods are frequently used:./My. ShOrSource my. ShOr. My. Sh; What are the differences between the three methods? Let's take a look at how to call
[Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]
Like awk, sed is an important text filtering tool.
Calling SED is the same as calling awk. There are three methods:
1. Type A command
[Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]
In this section, let's take a look at a w k's many powerful string functions and their usage methods.1. sub and gsub functions:
Usage:
Quick query of Linux Shell syntax compiled by myself (comparison using C language syntax)
Although I have learned Linux Shell programming, there are only a few chance to write shell scripts (usually I write more when setting up a development
Location parameters can be used
shiftCommand left shift. For example
shift 3Indicates the original
$4Change
$1, The original
$5Change
$2And so on.
$1,
$2,
$3Discard,
$0Do not move. Without Parameters
shiftThe command is equivalent
shift 1. Very
1. 12 steps of bash command processing;
1. Divide command lines into tokens separated by fixed metacharacters;
SPACE, TAB, NEWLINE, ; , (, ),, |,&
The types of tokens include words, keywords, I/O redirections, and semicolons.2. Check the first mark
1. Linux script compiling Basics
1.1 Basic syntax Introduction
Start with 1.1.1
The program must start with the following line (must begin with the first line of the file ):
#! /Bin/sh
Symbol #! The parameter used to tell the system that the program
Standard Input/Output and redirection: The Fedora Core Linux is released in Linux, and the development team of Red Hat Linux will continue to participate in the development of this release.
Standard Input and Output
We know that when executing a
What is the difference between shell learning ?, Where does shell learn?Strictly speaking,
Because 0 is the default value of
> This method is used to export data to a file. If the file does not exist, the file is created. If the file exists,
Use of shell Learning () and {}In shell command line, the average person may not care much about the differences between the two pairs of symbols () and,Although both of them can group multiple commands, the technical details are quite different:()
The following program implements a simple mp3 playback function. You can set the path to search all mp3 files and play them in sequence.
#! /Bin/sh # very simple example shell script for mp3 player #2014-5-6 by slwang # search all mp3 files and play
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