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:
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
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
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
#
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:
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"
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
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
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
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
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,
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
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
#!/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
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
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