Shell Pull Process

#!/bin/shMm= ' Ps-ef|grep memcached|grep-v grep|wc-l 'While ["$MM"-eq 0]Doecho "$ (date +%y%m%d%h%m%s), the memcached is down,try to up it" >>/data/shell/men.log/usr/bin/memcached-d-u root-m 512-p 39999-c 1024Sleep 2sMm= ' Ps-ef|grep

Shell Script (ii)

1.Until Loop statement#!/bin/basha=10;until [[$a-lt 0]];d oecho $a;((a--));d one;2.case Selection Statement#!/bin/bash#auto install lamp#by 2015-6-30case $1 in          apache ) echo  "Wait for install httpd server ..." yum  install http* -y;;       

Shell script Programming

1. Write the shell script, calculate 1-100 's and;#!/bin/bashsum=0;for((i=0;i100$sum$i ))}echo$sum2) Write the shell script, ask to enter a number, and then calculate from 1 to the input number and, if the input number is less than 1, then re-enter

Shell Text Word Count

The contents of the Words.txt are as follows:The day is sunny the the the the and the Sunny isCount the occurrences of each word and output in descending order.The Unix pipes script is as follows:Cat TR ' ' ' \ n ' Sort Uniq Sort awk ' {print $, $

Linux shell directives such as-D,-F,-E, and other judgment expressions

Source:http://zhidao.baidu.com/question/322131711.htmlFile comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file

Shell Script-1

.: Denotes any character*: Matches the previous character, A * indicates: 0 or more A+: Matches the preceding character to represent 1 or more preceding characters?: matches the preceding character to represent 0 or more preceding characters#!

IFS usage in the shell

I. Introduction of IFSthe Shell script has a variable called IFS (Internal field seprator), the internal domain delimiter. The full definition is the shell uses the value stored in IFS, which are the space, tab, and newline characters by default, to

Shell Regular Expression

basic regular expression metacharacters role * matches the previous character 0 or more times . match any character except newline

Linux Shell Script Raiders (1.12)

1.12 Functions and Parameters Like other scripting languages, Bash also supports functions and can pass parameters. 1.12.1 function definition and parameter transfer#!/bin/bash function fname () #也可以用fname () instead of {echo $1 , $

Shell <<eof

1, consider the following requirements, in the main shell execution command, enter the other command, the input after, want to as the input of the command, instead of the main shell input, how to do?2, use 3. The EOF here is just a delimiter and can

"Column directory" of Shell programming learning

for a list of the current path under the directory (not the list of directories) method, and share with you ~ ~1. Using ls-d with wildcard charactersls-d * * 2, ls-f with grep query with/end of the content-F: Displays the directory behind the/ls-f |

Shell analyzes which programs are occupied by the swap partition (stress simulation environment)

1. View versionCat/etc/debian_version7.82, look at the memory (my side is 256MB memory swap divided by 4G)Free-mTotal used free shared buffers CachedMEM:231 124 106 0 8 79-/+ buffers/cache:36 194swap:3814 0 38143. Using stress to simulate the

A shell script that you wrote to patrol the Linux process

#/bin/Bashhint () {Read-P"Press Enter Tocontiune:"}check_a () {PS-ef |grepCxiang|awk '{for (i=1;i'Text1//use grep and awk to filter the process into Text1. sed '/^.*/s///g'Text1 >text3//delete Text1 in front of empty row in Text3grep-VWF Text3 Text2/

Shell Script intercept Date processing

[Author]: KwuDate formatting fixed to 8 bits in Linux: 2015-01-01String processing required for implementation in 2015-1-1#!/bin/sh# upload logs to hdfsyesterday2= "2015-01-08" Echo ${yesterday2}first=${yesterday2:5:1}second=${yesterday2 : 8:1}echo $

Linux Shell string Cutting built-in method

$MYSTR ="node=slave-01:2.05:1.25:1.00"$ time tmp=${mystr%%:*}; echo ${tmp##*=}real 0m0.000suser 0m0.000ssys 0m0.000sslave-${string#*pattern} minimizes matching pattern from the left and deletes (starting from the left) the first pattern

[The source command in the]shell is followed by a dot space and a description of the executable file

It's recorded in a shell script.. ./file.sh and/file.sh the difference, this article refers to the http://www.lslnet.com/linux/dosc1/39/linux-283534.htm (this blue forest thing should be derived from Chinaunix)A little experiment.Scenario One:VI

Write a shell script to count the local traffic during a certain time period

Below is the output information of my wlan0 NIC, you can use Ifconfig or Ifconfig | Sed-n '/wlan0/,10p ' gets the format of the displayed informationwlan0     Link encap:ethernet  hwaddr xx:xx:xx:xx:xx:xx             inet addr:172.29.164.251  bcast:

Shell theory Study (v)

1. Communication status650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/79/wKiom1VJ15KAhrdGAAPwr4Vr-4M504.jpg "title=" 1.jpg " alt= "Wkiom1vj15kahrdgaapwr4vr-4m504.jpg"/>2. Start-Up service650) this.width=650; "src=" http://s3.51cto.com/

Shell's $

$$: The process ID representing the shell script $!: The process ID representing the last executed shell script $?: Represents the return value of the last executed shell command $*: Represents all parameters in the form "parameter one

Shell script to delete the folder N days ago ----- the difference between the date command on linux and mac

Shell script to delete the folder N days ago ----- the difference between the date command on linux and mac Background:Every day you build things and put them in different folders by date. For example, today's construction is put in, tomorrow's will

Total Pages: 541 1 .... 505 506 507 508 509 .... 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.