The logical operators of the shell involve the following types, so as long as the appropriate choice, can solve our many complex judgments, to achieve a multiplier effect.First, the logical operator
Logical Volume Label
Express
Linux Shell reads a lineMethod OneBy specifying IFS--Internal Field Separator , by IFS default , you can set a value in the script IFSDEMO 1$cat t1.txt abcfd $cat test_IFS.sh #! /bin/shIFS="c"for LINE in `cat t1.txt`do echo $LINEdone$sh
Article from my personal blog: (Linux shell) Chapter II-The Joy of command (a)In the previous chapter we described some of the syntax that we need to be aware of in the Linux shell, and then we begin to understand the common commands of the Linux
'.' Matches any character
'*' Specifies that * can be used repeatedly for any number of times.
'^' Starts with a string
'$' String end
'. *' Any number of characters
'\' Escape Character
'[...]' Matches any character
'[^...]'
Recently, Google was completely banned, and the code hosted on the Google SVN server was inaccessible.It's a waste of things. I unloaded the slow Win8 running in my old notebook, installed Ubuntu, mounted the svn server, and managed some personal
Understanding and learning Shell
The shell version used in Linux is called "Bourne again shell (BASH)". This shell is an enhanced version of the Bourne shell and developed based on the GNU architecture.BASH Shell functions
1. Command memory function:
Scan all hosts in the network segment. Online hosts are displayed in green. Offline hosts are displayed in red;
Finally, the numbers of online and offline hosts are displayed respectively;
In order to practice shell, only the for loop is used here,
Typeset can be used to set variable attributes, such as case, width, and left-right alignment. When typeset is used to change the attributes of a variable, this change is permanent, the following uses KSh as an example to demonstrate the
Tag: Shell
Shell task control terms:
(1) Foreground task: Run in shell. The shell prompt does not appear before the task is completed, so other tasks cannot be run at the same time.
(2) Background task: Run in shell, but not exclusively in shell.
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
There are many blank lines after extracting the log files to be viewed recently, which is not conducive to the comparison of previous files. In order to be backward compatible, only empty lines can be deleted when obtained. I googled myself and used
The script is as follows:
#! /Bin/sh # Name of the process to be checked progress_name = "heihu_server" # ------------------------------- # function: checkprogress # function: Check whether a process exists # parameter: $1 --- Name of the process to
Three types of commands can be used in shell scripts:
>>> Unix Commands
Although any Unix command can be used in shell scripts, some more common commands are used. These commands are usually used for file and text operations.
Common command
Option name
Format
Description
-Ls
-Ls
View the current directory structure of the specified path
-LSR
-LSR
Recursively view the directory structure of a specified path
-Du
-Du
Measure the file
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