Error One:The alias of the field cannot be used after Hive's where,Error Two:A custom function cannot be used in Hive's groupby, otherwise an error (replaced with a nested select)Error Three:When executing: $./hive_game_operationstatis5.sh, the
In this paper, the basic syntax of the shell is briefly recorded for future use!1. Shell variablesWhen you define a variable name without the dollar sign $, you only need to add the dollar sign before the variable name when using the variable. As1
Use the shortcut keys to reduce the number of mouse clicks, thereby improving efficiency, below is the summary of the Shell shortcut keys:CTRL + A cursor goes to the beginningCtrl+e cursor goes to end of lineCTRL+F cursor moves one character to the
Very good!!Very good!!DeleteCTRL + D deletes the character at the cursor location equivalent to VIM x or DLCTRL + H deletes the character in front of the cursor, which corresponds to the HX or DH in vim.Ctrl + K Delete all characters after cursor
http://blog.csdn.net/gyanp/article/details/7258356It is often possible to find the following form of command invocation in some scripts, especially when Crontab calls/tmp/test.sh >/tmp/test.log 2>&1The first half of/tmp/test.sh >/tmp/test.log is
The anti-quote bit (') is located above the TAB key of the keyboard, to the left of the 1 key. Note the difference between the single quotation mark (') on the left side of the ENTER key.Anti-quote bit (') plays the role of command substitution in
The Linux Write command allows users to talk to users on other terminals. Implement the shell command write in C, with the following code:#include #include #include #include #include #include #include #include #include char *
As mentioned above, the shell is a scripting language, so there must be an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell.we often
1, mkdir newdir: New directory2. Touch filename: New file3. Vi/vim filename: Edit file4. grep [-ACIVN] [-A] [-b] [--color=auto] ' Search string | | Regular expression ' filename : A matching row was found from the file and displayed-A binary file
[[Email protected] shell] # Cat shift. Sh #! /Bin/bash Until [$ #-EQ 0]; do Echo "the first is: $1 total is $ #" Shift Done [[Email protected] shell] #./shift. Sh 1 2 3 4 5 6 The first is: 1 total is 6 The first is: 2 total is 5 The first
Method for obtaining the process ID by shell:
I know there are three things I have learned and practiced:
PS-A | grep "cmdname" | awk '{print $1 }'
Pidof "parameter name"
Pgrep "cmdname"
The three running results in bash and busybox ash
A lot of balls form a pyramid
Layer X has x * (x + 1)/2 balls.
Give you a second to represent the second ball at the first layer of the pyramid.
The number of rows in the layer at which it is located
Formula 1: x * (x + 1) * (x + 2)/6
Formula 2: x *
Tag: Shell
Hup (1) suspended, usually caused by terminal disconnection or user exit
INT (2) interrupt, usually caused by Ctrl + C Combination
Quit (3) exits, usually caused by Ctrl +/Combination
Abrt (6) abort, usually caused by some serious
Today, I wrote a shell monitoring script to monitor the running status of keepalived by combining the shell script with zabbix. The script name is check_keepalived.sh #! /Bin/bashunm = 'ps-Ef | grep keepalived | WC-l' if [$ UNM-GT 2]; then Echo 1;
Requirement: traverse all APK installation packages and install them in batches.
Idea: there should be many ways to implement it, but I am not familiar with shell commands. I chose the simplest one. The find command should be simpler and updated
1. clearnginxlog. Sh
#! /Bin/bash
# Run at 2: 00 am every
Nginx_pid = "/run/nginx. PID"
Logs_path = "/opt/log/nginx"
Logs_date = "$ (date-d" yesterday "+" % Y % m % d ") _ 'date + % Y % m % d % H % m % S '"
MV $ {logs_path}/access. Log $
Shell loop, shellloop1. LoopThe shell loop continues to execute a program until it meets the conditions. There are four types of loops: while LOOP, until loop, for fixed processing, and for numerical processing.2. while LoopThe while loop is
Shell acronyms and judgment symbols []1. The test command is used to detect the file type and compare values. Determine whether a file exists:
[work@www sh]$ test -e file.txt && echo "exist" || echo "not exist" not exist[work@www sh]$
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