Shell scripts run Hive SQL

#!/bSTART=$(Date+%s);d Atebegin=`Date-D" $" "+%y%m%d"' DateEnd=`Date-D" $" "+%y%m%d"' Sdate=`Date-D"$datebegin-1 days" "+%y%m%d"` while["$datebegin"-le"$dateend" ] DoEcho$datebegin/usr/local/hivebi/bin/hiveEOF--Hive SQL Like:drop TABLE IF EXISTS

Linux Shell Command (Quick Study)

CD/: Entry root directory-----------------------[Email protected]:/etc$ CD/[Email protected]:/$ pwdCD ~: Entry user root directory----------------------[Email protected]:/$ CD ~[Email protected]:~$ pwd/home/tangymls : List all files.pwd : Show

Common techniques in Shell programming

1 loops (Command execution ... But the parameter will change)As in the following form:#!/usr/bin/env bash#encoding=utf-8a= "Value1value2value3value4value5value6" for I in $ado echo "cmd $i argv" doneNote: $a cannot be written as a "$a", otherwise it

LINUX Shell condition judgment

conditional judgment of arithmetic operation [] [[]]:-eq-ne-Lt-le-gt-GE(( )):>>==[[Email protected] ~]# if ((2 = = 3)); then echo ' 123 '; Fi[[Email protected] ~]# if ((2 >= 3); then echo ' 123 '; Fi[[Email protected] ~]# if ((2 123[[Email protected]

Several methods for Shell to determine string inclusion relationships

Now every time you analyze the site log, you need to determine whether Baidu Spider is a real spider, after nslookup need to determine if the result contains "Baidu" stringThe following is a list of some of the methods that the shell contains to

Common Linux Commands Explanation (eighth day)--bash Shell operating environment

For the new company, the company's leadership is very good. I feel more of the place is, their work efficiency is obviously higher than before. In the past will be very impatient for frequent changes in demand, now received after the demand will be

Shell advanced usage--functions

In the shell, if a piece of code needs to be called repeatedly, the code definition can be called a function, which is called directly in a later script. There are two ways to define a function:1. function functionname {}2, functionname () {}Example:

Shell Scripting Learning notes-functions

1. Basic Scripting functions1.1 Definition of functionFunction name { commands}OrName () { commands}1.2 Simple example#!/bin/shfunction FUNC01 {echo "This is the function of FUNC01"}FUNC02 () {echo "This is function of FUNC02"}FUNC01FUNC02

Shell two file comparison, same character removed to another text

##!/bin/bashecho "pleases Enter A.txt file (enter Q to exit)"READ-DQ Aecho ""echo "pleases Enter B.txt file (enter Q to exit)"READ-DQ Becho ""Cat >/root/a.txt $AEofCat >/root/b.txt $BEofC= ' Cat/root/a.txt | Grep-f/root/b.txt 'D= ' Cat/root/a.txt |

Linux Shell-' dirname $ ' to navigate to the relative location of the run script

Example 1.The new test.sh content under/home/admin/test/is as follows:CD 'dirname $0echo 'pwd'Then return to/home/admin/to executesh test/test. SHOperation Result:/home/admin/testThis allows you to know the location of the files deployed with the

Shell Color configuration under Linux

Color configuration involves the following places (I often use): command prompt, file and directory name display, ECHO-E command1. Color values are divided into foreground and background colors, and the corresponding relationship of color code

Shell------Print a line with only one number in the document

Write a shell script that requires you to print a line that contains only a single number in the document:#!/bin/bashfor i in ' cat/root/passwd ';d o n= ' echo $i |sed ' s/[^0-9]//g ' |wc-c ' #echo $n if [$n-eq 2];then Echo $i else continue

Linux shell Programming

1. Variable and variable values (expanded)If you need a variable name, use the variable name directly, or if you need a variable value, use the $ symbol. For example:Export Path=/home/bin: $PATHIf you're not sure if you want the variable or expanded

"Shell" variable

Variable settings:~/dos # dfs=2 Variable use:You can read it using EHCO, but you need to precede the variable name with $, or the ${variable}.~/dos # echo $dfs 2 ~/dos # echo ${dfs}

Prevent long execution of shell scripts resulting in SSH timeouts

In some scenarios where security requirements are high. SSH timeout is pre-set by the administrator, after idle for a period of time SSH connection will be actively disconnected.This scenario assumes that the script runs through SSH and the script

Reproduced String interception of Linux shell scripts

Suppose there is a variable var=http://www.google.com/test.htmA # Intercept, delete the left character, and leave the right character.Echo ${var#*//}where Var is the variable name and the # is an operator, *//indicates that the first//number and all

Enterprise's Ftp+shell+crontab Backup production data

Backup of FTPPurpose : through Shell to upload the backed-up data to another server. FTP back up the server. Simulation Tomcat for production data. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/BB/wKioL1bvOoaiyYeLAAAjXEUp800094.png "

Linux Basics: The usage of regular expressions in the shell

In Linux systems, regular expressions (regularexpression) are powerful tools for finding, replacing, deleting, and so on for every Linux user, through the arrangement of special characters.In existing systems, regular expressions are also divided

Linux Basics: The usage of regular expressions in the shell

In Linux systems, regular expressions (regularexpression) are powerful tools for finding, replacing, deleting, and so on for every Linux user, through the arrangement of special characters.In existing systems, regular expressions are also divided

Concurrent concurrent shell scripts simulating multithreading in Linux

Share a concurrent script that simulates multithreading under Linux, using this script to execute related commands on a defined number of servers at the same time, which is much more efficient than a normal for/while loop and can be executed in a

Total Pages: 541 1 .... 376 377 378 379 380 .... 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.