Shell Instruction Expr Usage guide

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 Intercept __linux

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

Small knowledge of shell programming

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

Learning notes: [$*],[$@] and [$#] in a shell script [$?] [$] [$] [$] [$!] ... What do you mean, separately?

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:

Uppercase and lowercase conversions in play shell

#!/bin/sh For f in * Todo MV $f ' echo $f | TR "[: Upper:]" [: Lower:] "' Done ---------------------------------------------------------- [: Upper:] [A-z] [: Lower:] [A-z] [:d Igit:] [0-9] [: Alnum:] [0-9 A-z] [: space:] spaces or t a b keys [:

Introduction to Linux awk and shell variable delivery __linux

First, awk uses ordinary variables in the shell Method 1: Use the quotation mark method Aa= "Hello" awk ' BEGIN {print ' $aa '} ' Output $AA awk ' BEGIN {print ' $aa '} ' Output Hello awk ' BEGIN {print ' ' $aa '} ' Output empty Aa= "hello!

Linux Automatic backup shell (using full backup, incremental backup strategy) __linux

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 #

Spark Shell Startup error problem

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

Java Remote invoke shell script

Import java.io.IOException; Import Java.io.InputStream; Import java.io.UnsupportedEncodingException; Import Java.nio.charset.Charset; Import Org.apache.commons.io.IOUtils; Import ch.ethz.ssh2.ChannelCondition; Import

Linux execution Shell script hint file cannot find problem resolution __linux

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

Shell for Learning

#!/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} '

Ways to get the shell script to execute automatically

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

Script Automatic Login shell script (compact version)

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

Bash Shell recursively implements file copy in directory

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

Shell nested conditional statement, as far as possible close to two times to judge

if [$#! = 2] Then if [$ = "H"-O $ = "H"] Then echo "Help Info" Else echo "Error:invalid argument amount! Plz Input 2 directory names! " Fi echo "**************************************************************" echo "* by Richard Zhang, Oct, 2008.

Impala-shell Import and Export data

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

HBase Common shell commands

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 Shell Details

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

Programming commands for Shell scripts

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

Shell Programming-Introduction (I.)

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

Total Pages: 541 1 .... 341 342 343 344 345 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.