On the ">/dev/null 2>&1" of shell

From: http://www.ixdba.net/a/os/linux/2010/0422/35.html "When reprinted, please indicate the source of the article and the author's information and this statement in the form of a hyperlink"Original link: http://www.ixdba.net/a/os/linux/2010/0422/35

Linux Shell Script Example (iv)

Example No. 2As a shell writer, often face the problem of inconsistent data format, the data standard session output is a need to solve the problem, this example takes MySQL time as an example, the script enters the month, the day, the year three

Shell Script Exercise II

Print 99 multiplication table#for Statement Format#!/bin/bashfor ((a = 1; a Dofor ((b=1; bDoLet Sum=b*aEcho-ne "$a * $b = $sum \ t"Doneecho ""Done#while Statement Format#!/bin/bashA=1While [$a-le 9]DoB=1While [$b-le $a]DoLet sum= $a * $bEcho-ne

There are two ways to run a Shell script:

1. As an executable programSave the above code as test.sh and CD to the appropriate directory:+./test. #使脚本具有执行权限./test. #执行脚本 Note, be sure to write ./test.sh, not test.sh, run other binary programs also, the direct write Test.sh,linux

Shell script Color output (instance not edited)

Color output via echo output, need to add-EECHO-E "\033[background color; font Color \033[0m"Background color40 Setting a black background41 Setting the red background42 Setting the green background43 Setting the brown background44 Setting the blue

Shell scripting introduction, structure and execution, variables, and date command usage

First, Shell script introductionThe shell is a scripting language, and the shell is a collection of system commands1, can use logic judgment, cycle and other grammar;It's a bit like C language, but it's fundamentally different.2, can be customized

Shell Programming Specifications and variables

Concept:The commands that will be executed are saved sequentially to a text file, which can be run by giving the file an executable permission.The composition of the shell script:1) Script statement: The script declaration indicates which

Shell command usage and common use cases under Linux: SED

Click to view the original blog.sedis the abbreviation for Stream editor, which is a non-interactive stream editor for filtering or converting text.Not to be continued ...ProfileSed Options ... Script [Input File ...]DescribesedThe editor is called

Shell Programming II Conditional judgment

1. Expression of conditional judgment: [ 表达式 ] 或者 [[ 表达式 ]] 或者 test 表达式,要注意的是[ ]或者[[ ]]中括号内要与表达式之间用空格隔开,否则会报错。2.if Else FI conditional statement 格式: if 条件 ;then 如果条件为真则执行这里的语句 else

The role of various parentheses (), (()), [], [[]], {} in the shell

Tips Summary:String comparison with double brackets [[]]; arithmetic comparison with single brackets []--left and right spacesArithmetic operations with double parentheses (()); Shell commands and output parentheses ()--left and right without

01-01 Shell-based data analysis

#!/usr/bin/env BashFor year in/root/downloads/data/all/*DoEcho-ne ' basename $year. gz ' "\ T"Gunzip-c $year | \awk ' {temp = substr ($ 88, 5) + 0;Q = substr ($ 93, 1);if (temp! = 9999 && q ~/[01459]/&& temp > max) max = temp}END {print Max} 'Done#!/

Linux Learning-----Shell Basics

Shell Basics1. What is a shellShell is a program developed by C language he is a bridge for users to use Linuxis both a command languageAn application This application provides an interface through which users access the operating system kernel's

Self-study Linux Shell5.1-shell parent-child relationship

Click Back to learn the path of the Linux command line and shell script5.1-shell Parent-child relationship1 common types of shells Bash is the Linux standard default Shell, which is an abbreviation for the Bunrneagain shell, with a total of

function and cyclic control of Linux--shell programming

Functions: Code snippets that implement standalone functionalityfunction is only executed when calledSyntax One:function f_name{function body}Syntax Two:F_name () {function body}The return value of the function:Default function return value:

Shell Multi-process instances

Shell Multi-Process basics Code block: With {} as a whole & function: Put the command in the background processing, idle out the current console for other operations Wait command: Waits for the parent process to execute the

Shell date format and numeric operations

#!/bin/Bash#declare D="2016-05-06 00:00:00"#d1=$(Date-D"$d"+%s);Echo$d 1#d2=$(Date+%y%m%d%h%m%s-d @ $d 1) #Echo$d * Current time month day #declare Currentsecond=$(Date+%y%m%d%h%m%S) #declare currentminute #当前时间 month and day=$(Date+%y%m%d%h%M)

Linux Learning Summary (58) Shell Script 2-Logical judgment if

13 Basic IF statementsFormat 1:if condition; Then statement; FiExecution result is 5Format 2:if condition; Then statement; else statement; Fi#!/bin/basha=5if [ $a -gt 10 ];then echo $aelse echo 0fiExecution result is 0Format 3:if ...; Then ...; Elif

Considerations for using SSH-free remote command execution in a loop in Shell programming

Prerequisite: Configure your own machine ssh password-free login#!/bin/bashCat list1234EODWhile Read lineDoif SSH [email protected] "test-f/tmp/a.sh"; Then #配置了免密登录, no password is entered hereecho "$line file exist."Elseecho "$line file not exist."

[Shell]find command

Find./-mtime 18-exec ls-l {} \;Special places in this example are {} and \; And the-exec keyword, the meaning of these things: {} stands for "content found by find" and, as shown, the result of find is placed in the {} position; -exec

SHELL–ITEM2 Color

DownloadPlease download it to https://github.com/mbadolato/iTerm2-Color-Schemes.git clone https://github.com/mbadolato/iTerm2-Color-Schemes.gitInstallationTo install: Launch ITerm 2. Get the latest version at iterm2.com Type cmd+i (? +i)

Total Pages: 541 1 .... 313 314 315 316 317 .... 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.