SQL statement writes shell with log

OutFile is forbidden, or written files are intercepted;Operations in the database are as follows: (must be root permission)Show variables like '%general% '; # View Configuration Global general_log = on; # turn on general log mode Global

Shell Script Basics (iii)

One, for loopThe For loop structure is a very frequent loop structure used in daily operation and maintenance work.1. For loop specific format:for 变量名 in 循环条件; do commanddoneThe "loop condition" here can be a set of strings with numbers

The skillful use of the shell command cut

Requirements: Remove the IP field from the log and sort the statistics. General use awk command if the IP address is the first field thenawk ' {print '} ' filename |sort |uniq-c|sort-nrWhat if it's not the first field and there are several

Use of case in shell scripts

The case selection statement in the shell script can be combined with the read instruction to achieve a good interactive response operation, case receives one or more parameters passed in by the read instruction, and then the case is selected

Bash Shell concludes "three"

Cat Head Tail grep Sed awk Cut WC Sort Uniq TR TAC Rev Cat, Concatinate, connects the contents of one or more files sequentially, outputting them to the standard output.Cat 12.pub Cat-n 12.pub Cat-a file # Merging filesCat 12.pub 13.pub 14.pub

Bash Shell Summary

Mans Bash1. How the Shell works (1)Kernel Shell UsersParent Process Fork---waitChild process Exec--exitRelated Man documents:Fork (2)Clone (2)Execve (2)Exit_group (2)EXIT4 (2)Strace (1)-->strace-e2. Shell Syntax (2)1. Simple command (kw:simple

Shell Script Programming Learning notes-for loops

1.FOR Loop structure 1.1 for loop structure syntaxGrammar:For variable name in variable Value listDoInstructions...DoneTip: In this structure, "in variable Value list" can be omitted, when omitted is equivalent to in "[email protected]", using for I

Linux Logging User shell command

Add the following in/etc/profile: Export lc_all=ctmout=3600histfilesize=2000histsize=2000histtimeformat= "%Y%m%d-%H%M%S:" Export Histtimeformatexport prompt_command= ' {command=$ (History 1 | {read x y; echo $y;}); Logger-p local1.notice-t bash-i

hdu5730 Shell Necklace "Divide and conquer FFT"

Tag: while void \ n Const floor How long def lengthTopicBriefly: There is a shell of length n, divides it into several segments, gives the number of schemes divided into each length, and asks how many kinds of partitioning schemes

Shell script programming Shell files contain

1. Like other languages, the shell can also contain external scripts, which makes it easy to encapsulate some common code as a standalone fileExample: The testshellfileinclude.sh script is as follows:the #!/bin/Bash#shell file contains the following

The "shell" Linux shell determines whether the variable entered by the user is a number

This article: Determine whether the user input parameter is a numberHow is the calculation done in the shell? Way One [[email protected] scripts]# echo $((1+2)) 3 Way Two Note: When using the method two, the requirements

"Shell" Linux Shell Case detailed

In general, case is a judgment statement that is easier to understand than if.Case Statement Formatcase in 变量 值1) 内容 ;;值2) 内容 ;;esacNote: Each content needs to be added after;; , can be written across rows or peers. Instance: Executes

Shell Script Programming Learning notes-functions

1. Why use a functionLook at the role of aliases first[[email protected] ~]# alias httpd=‘/etc/init.d/httpd‘[[email protected] ~]# httpd start正在启动 httpd: [确定]function is to call the program multiple times the same code part is defined as a copy

Shell Script Advanced

Shell script advanced One, Shell script advanced condition test When you write a shell script, you often need to judge some conditions, and you can use Test command test to help complete the test process. The test command tests whether a

Shell Script Programming Loop statements

ForWhileIfCase 1. for usage 1 for 变量 in 值1 值2 值3..;do 执行语句 done Usage 2for 变量 `命令`;do # 可以引用命令执行结果 执行语句done Usage 3for ((初始值;循环控制;变量变化));do 执行语句done #C语言风格的for循环用法For loop

Shell script Dish

Shell Script Menu Operation case:#!/bin/bashwhile truedo#       clearcat Shell script Dish

Explanation of Bash Shell terminal in Linux

Shell: is an outer layer of the kernel Protection tool, and is responsible for the completion of user-to-kernel interaction;Provides an interface for users to interact with the kernel, which receives commands entered by the user and sends it to the

Shell exercises (15)

Exercise 1:Monitor network cardrequirements: every 10 minutes to detect the specified network card traffic, if the network card traffic is 0, restart the network card! (Use cron Task Scheduler!) )Reference Answer:#!/bin/bash# date:2018 March 21 lang=

Shell script (2)-if statement

If statement1. What is a conditional test operation?To make a shell script "intelligent", the problem is to differentiate between different situations to determine what action to take. The shell environment, based on the return status value ($?)

Arrays in the shell

Defining arraysA= (1 2 3 4 5 6)Print arrayecho ${a[@]} or echo ${a[*]}[[email protected] shell]# a=(1 2 3 4 5 6)[[email protected] shell]# echo ${a[@]}1 2 3 4 5 6[[email protected] shell]# echo ${a[*]}1 2 3 4 5 6Print the elements in an array by

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