In the Linux shell command expr is not very noticeable, but it works very well. So far, I personally think the biggest role is two-arithmetic and string operations.
First said arithmetic, in the shell arithmetic not simple subtraction, should write
Linux Shell string interception is useful, there are eight ways:
Assuming there are variable var=http://www.aaa.com/123.htm
1. # Intercept, delete left character, keep right character.
Echo ${var#*//}
where Var is the variable name, # is the
First, the user login into the system after the system environment variables:
$HOME user's own directory
$PATH directory to search for when executing commands
$TZ Time Zone
$MAILCHECK every few seconds to check for new letters
$PS 1 The prompt
For example, the
script name is called test.sh Three: 1 2 3 is as follows
./test.sh 1 2 3
After running test.sh 1 2 3
$* is "1 2 3" (enclosed in quotes)
$@ is "1" "2" "3" (wrapped separately)
$ #为3 (number of parameters)
Case 2:
ZZ http://www.cnblogs.com/coffee_cn/archive/2010/03/26/1697038.html
Set in Cron, perform every Monday 2 o'clock in the morning (full backup every Monday, incremental backup for the rest of the time) #vi backup.sh
#!/bin/bash
#
Error description: Direct start Spark-shell,pia, error, has been so started, ah, a little wrong. When you are in a bad mood, really want to delete it, and then the next version to use. But think about if the download is also this appearance, then I
When executing a pre-existing shell script file under a Linux system, it prompts you that the file does not exist.
The general reason for this is that your shell script is written in a system that is inconsistent with your execution script, such as
#!/bin/bash
for_1 () {
echo ' for 1 show item ' for
var in item1 item2 ... itemn do
Echo ${var};
Done
}
for_2 () {
echo ' for 2 show 1~5 ' for
loop in 1 2 3 4 5
do
echo ' The value is: ${loop} '
Redirect Method
When the shell sees
#!/bin/bash
GDB
Help
Quit
Eof
Pipe mode
The combination of the Echo, Sleep command, and pipe operator (|).
#!/bin/bash
(Echo ' root '; sleep 1; Echo ' root ') | passwd
Modify the root user's
Background: Work on a variety of online machine landing scripts, and some need to log into the board before landing on the machine, and some dynamic password, each input is very troublesome, the use of automated landing scripts to manage too
PrefaceThere is a problem with working today, if you copy the file in directory A to directory B (without the file in directory B), and keep the file structure in directory A. The project focuses on the following: You need to keep the structure of
Impala-shell Import and Export
Parameter description:
-q Query (--query=query) executes queries from the command line without entering Impala-shell
-d default_db (--database=default_db) Specify database
-b (--delimited) to format the
Enter HBase Shell console
$HBASE _home/bin/hbase Shell
If you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell to enter the certificate successfully. You
HBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data to tables, listing
1:test variable-get 80 to determine whether it is greater than [] =test2: Use the regular expression to use [[]]3: [[]] = = Same, string do not add "" to this wildcard character=~ match, string do not add "", support extended regular
1. Shell ConceptThe shell is a program written in C, which is a bridge for users to use LinuxThe shell is both a command voice and a programming voiceA shell is an application that provides an interface through which users access the operating
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