shell--3, Shell Pass parameters

We can pass parameters to the script when executing the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to execute the script,

Common shell Scripts

#!/bin/bash # Check if the 192.168.1.1-192.168.1.254 host is aliveFor IP in 192.168.1. {1..254};DoIf ping-c 1 $ip >/dev/null; Thenecho "$ip OK."Elseecho "$ip no!"FiDone#!/bin/bash #检查多个域名是否可以访问Url= "www.baidu.com www.sina.com www.jd.com"for URL in

Shell uses the Paste command to stitch multiple files by column

Test documents:[email protected] shell-script]# cat Text1.txt12345[email protected] shell-script]# cat Text2.txtOracleMysqlPostgreSQLHadoopSparkUsing Paste stitching text1.txt text2.txt file contents:# paste Text1.txt text2.txt1 Oracle2 MySQL3

Linux Shell Script Programming learning notes and combat

Http://www.1987.name/141.htmlShell Basics Terminal printing , arithmetic operations , frequently used variables Search for a specific string under the specified folder and highlight matching keywords under Linux Get standard input from a

Shell Judgment Statement

File judgment operator–b return True when file exists and is a block file-C Returns True when file exists and is a character-D returns True when pathname exists and is a directory-E Returns True when a file or directory specified by pathname is

On-my-zsh pretty shell.

OneHttp://www.cnblogs.com/GarveyCalvin/p/4301235.htmlTwoForeword: Zsh can be configured strong, user can customize the configuration, personalization is strong. Zsh Tab Completion is more powerful, this feature allows us to save a lot of time. Zsh

Practice of shell Special extended variables

Bo main name: Li ChangmingBlog Address: http://keep88.blog.51cto.comThis note is from the old boy books: Learn Linux OPS Shell programming with old boysSpecial extension variables1. ${parameter:-word} Functional PracticeThe role of ${parameter:-word}

Get time in the shell as a folder format

Recently wrote a small program, need to use time. Traverse as part of a folder#!/bin/bashfor i in {1..30}dodate= ' date +%y/%m/%d-d "$i days Ago" ' Echo $datedoneFor loop, take the date of the recent n days.The core isDate= ' Date +%y/%m/%d-d ' $i

Shell Programming Basics

Shell Authoring Steps:1. Scripting Vim first.sh2. Write the complete test script Bash-n first.sh3. Granting permission chmod +x first.sh4. Execute the script./first.shPS Shell Script Learning first need to understand Linux, system commands and

Pytohn implementing the WC command in the Linux shell

#!/usr/bin/pythonimport sysimport osfrom optparse import optionparser  def  opt ():     parser = optionparser ()     parser.add_option ("-C",  "--char",                       dest= "Chars",                       action= "Store_true",                 

Shell's sed command to delete a variable with a "date time and so on" method

Shell's sed command to delete a variable with a "date time and so on" methodThe SED command deletes the specified content and may be known, for example, if you want to delete the line containing "Badboy" in a file, use the following command directly:

Shell string Handling

String slices:${var:offset:number}Offset: The number of strings to skipNumber: The string to be fetchedCases:Name= "Obama"${name:1:2}--Displays the result as Ba${name:1}--Displays the result as BamaTake the rightmost few characters of the string:

Shell Script (iii)

Excerpt from: Rookie Tutorial http://www.runoob.com/linux/linux-shell-echo.htmlShell command1. Echo commandString outputecho "ok! \c "echo "It is a test"Output: ok! It is a test2. printf commandFormatted output%d%s%fEscape sequence:\a: Warning

Wrote a simple Linux shell to download files

#!/bin/SH for((i=0; i -; i=i+1)); Do# Use the spider to detect if the requested resource exists and write the result of the request to a

Several commonly used text-processing shell commands: Find, grep, sort, uniq, sed, awk

Find File LookupFind txt and PDF filesFind. \ (-name "*.txt"-o-name "*.pdf" \)-printFind files that start with all lettersFind. -name "[a-a]*"Find all non-txt text with negative parametersFind. ! -name "*.txt"-printSpecify the search depth to print

Supplements: Shell Tricks Yes gadget

When you need to automatically answer the ' yes ' or ' no ' options in your script, you can invoke the Yes gadget with the following syntax:such as (for each query raised during the execution of a command behind a pipeline, send a custom content no

Using shell scripts to implement the Scheduled Tasks feature V1.2

2013.05.10 MyTask 1.2The main program sleep time is divided into several small fragments of time to sleep, to avoid prolonged hibernation can not respond to the system signal in time.2013.05.07 MyTask 1.1After releasing the mytask1.0 version

Shell Script-Compare two integer sizes

DevelopmentShellscripts are implemented with script arguments , respectively, andReadRead inthe way to compare2an integer size. Use conditional expressions (prohibitif) and remind the user to compare the results in the form of a screen output. Note:

Shell View System Basic information script

#!/bin/bashecho "IP:" Ifconfig |grep "inet addr" |grep-v 127.0.0.1|awk ' {print $} ' |awk-f ': ' {print $} ' echo ' Product Na Me: "Dmidecode |grep nameecho" CPU info: "Dmidecode |grep-i cpu|grep-i version|awk-f ': ' {print $} ' echo ' Disk info:"

Linux Shell Signal Inheritance

In the shell, send a signal to the process a lot through the CTRL key plus some function keys to achieve, here is the common CTRL key combination and its meaning: Key combinations Signal type Significance CTRL +

Total Pages: 541 1 .... 251 252 253 254 255 .... 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.