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 [:

Reasons for shell scripts not using source in ubuntu12.04 and solutions

Phenomenon: Prompt source:not found when source aaa.sh in shell script Reason: Ls-l ' which sh ' hint/bin/sh-> dash This means that the dash is used to parse. Change Back method: Command line execution: sudo dpkg-reconfigure dash Select No

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 shell programming Notes-Background execution command crontab__ block chain

The Backstage execution command, is puts the shell command to the system backstage to execute, does not display in the terminal, does not affect the user to continue to work in the terminal, even if the terminal closes the command also to

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 #

Linux shell Programming Notes-shell input and output -2-read-cat-pipe _ block chain

1. Read command The read command reads information through a keyboard or a line of text in a file and assigns a value to a variable. 1.1, read reading the keyboard data, the input of the content before the return of the data assigned to a variable:

Shell Programming Notes (four) __ programming

echo Color output position parameter variable a predefined variable read accept script arguments enter declare source command echo Color Output I just found out today . Echo can also output a string with a color : Echo-e "asdasd\e[1;32m ABCD \e[0m"

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

Linux shell Programming implementation of the ETL based on Hadoop (analysis) __HTML5

Gathen: 397706991, learning together Conf/hive.xml Specific shell code Download: http://download.csdn.net/detail/luo849278597/9490920 create table if not exists think_statistics (date_type_name string,date_name string,type int,type_ Name

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 Daemon Shell Script __linux

http://blog.csdn.net/special23/article/details/52690057 Service-side programs generally need long-term background stable operation, in addition to ensuring the robustness of the program itself, but also need to use some daemons. Now share a simple

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

Recursion in a shell script

In shell scripts, the variables are global by default. So recursive calls require the local keyword to be used to display identity locals so that recursive calls to functions can be implemented. Wrote a recursive calculation of factorial script,

Essay 1:shell recursively traverse a folder

Recently work required, wrote some shell scripts to do server one-click Package Update, Traversing a folder with a for recursion contains spaces in the file name, which is treated as two files Workaround: Modify the delimited IFS #! /bin/bash

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

A loop-renamed Shell

#!/bin/bash db_ip= Db_user= Db_passwd= Db_name= a=98000000 function Addsql () { Ine2=$1 Ine3=$2 #sql1 = "Update table name set list = ${ine2} where id= ${ine3};"; sql1= "Update table name set sex=0 where id= ${ine3};"; echo $sql 1 Mysql-u $DB

Split of shell command

Listen to people say that text classification when processing 100G text files, incredibly without big data, processing method is to use the shell split to split into a number of small files. Split command NAME split-split a file into pieces

Total Pages: 541 1 .... 338 339 340 341 342 .... 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.