Reprinted from Jrckkyy final edit Zengzhaonong
Using shell variables in sed and awk----------------------------------------------x=mmSed ' s/ab/' $x '/g ' B.COrSed ' s/ab/' "$x" '/g ' B.CSed ' s/' "$val" '//' UrfileThe most recent process of
A simple description of the process of writing a shell script in Linux
1, use VIM or gedit to create a file, usually use. sh as a file suffix
2, "#!/bin/bash" as the first line of statements, which "#!" Known as the "Sha-bang" symbol, is the
Variable permutation command permutation formula substitution reference use backslash implementation reference use single quotation marks with double quotes
variable Substitution
There are four forms of substitution for variable permutationsSyntax
Some of the orders to be used in 2016/7/3 are recorded here, to be continued ...
2016/7/4 More ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View IP Address: windows:ipconfig/allLinux:ifconfig Ifdown disable the
(1) how the shell executes a commandLinux commands fall into two categories: one is the shell's built-in command, and the other is a shell-independent command. Don't forget, the shell is only a program in the system, when it executes a non-built-in
string Slices${#var}: Returns the length of the string variable var
[Root@centos6 ~]# alpha= ' echo {A. Z} |tr-d "" \ Create a variable to assign 26 letters to it, and no spaces
[Root@centos6 ~]# echo $alpha
abcdefghijklmnopqrstuvwxyz
[ ROOT@CENTOS6
The problem is:4) Known: The content of/etc/hosts is
192.168.1.11 oldboy11.etiantian.org
192.168.1.21 oldboy21.etiantian.org
192.168.1.31 oldboy31.etiantian.org
#192.168.1.111 oldboy111.etiantian.org
Please use the shell script to realize, how can
command Substitution
In Bash, $ () and ' (inverted quotes) are used for command substitution.The command substitution is similar to the variable substitution, which is used to reorganize the command line, complete the command line in the quotation
Because of the need to use the shell to develop a number of gadgets, when using an array as a function parameter, found that only the first element of the array can be passed, the elements behind the array can not be passed into the function.
The Java Execution Shell command has not been used before, and it is thought to be as convenient as C, and can be done with a system function. It's not that much of a problem today. There are two ways of executing shell commands in Java:
1. Use of
-S file file is somefile 0 o'clock
[f]: Determines whether it is a file [-
X "/bin/ls"]: Determines whether/BIN/LS exists and has executable permissions
[-n "$var]": Judge $va R variable has a value
["$a" = "$b"]: To determine if $a and $b
The difference between Su and Su-
The former only switches identities, but the shell environment is still the original user's shell, while the user and the shell environment switch to the new user. The PATH environment variable error will not
Original
To blur a lookup, you can write this. But Row_key can only be technical to the right of the query.
such as: row_1000, row_1001,row_1002,row_1003,row_1004,row_1005,row_1000,row_10006,
Scan followed by table name
Scan ' table ', {LIMIT = = 100
1.6.2 Default shell environment variables and PATH variable settings
1. Default shell environment variables
Bashshell default will use some specific environment variables to define the system environment. You can always rely on the variables set
use of string comparison X "$variable" in Shell
This article refers to StackOverflow why does shell script comparisons often use X$var = Xyes? do not use double quotes "", do not use prefix x do not use double quotes "", use prefix x use double
Recently learning a Linux script, here is the meaning of $, $, $!, etc. in shell scripts
Variable Description $$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return
Topic links\ (description\)There are \ ( n\) lengths ( 1,2,\ldots,n\) of beads, each with a \ (a_i\) species, each number of unlimited. How many methods are used to compose a string of length \ (n\) . Answer to \ (313\) modulo.\ (solution\)Make\
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