Linux Shell Combat (IPCS tools)

Source: Internet
Author: User

#!/bin/Bashwhoami=' WhoAmI 'if[$#-lt"1"] then echo'[program name] [Action Object]'Exit0fi# requires two parameters, parameter one: start line, parameter two: End line, parameter three: Operation Object function seddata{ forNumxinch' IPCS | Sed-n ${1},${2}p | Sed-n/${whoami}/p | Awk'{print $}'`     DoIpcrm ${3} ${numx} done}function startp{ Case$1 inch    "SHM") START= ' IPCs | Sed-n'/shmid/='' START= ' Expr $START +1' END= ' IPCs | Sed-n'/semaphore/='' END= ' Expr $END-2' #实际上, it's easier to match the empty line directly, for learning purposes #END="/^$/"Echo"start= $START; end= $END"seddata $START $END SHM; "sem") START= ' IPCs |sed-n'/semid/='' START= ' Expr $START +1' END= ' IPCs | Sed-n'/message/='' END= ' Expr $END-2' seddata $START $END sem;; "msq") START= ' IPCs | Sed-n'/msqid/='' START= ' Expr $START +1' END="/^$/"seddata $START $END msq; *) echo"the wrong argument! "        ;; ESAC}if[" $"=" All"]then STARTP SHM startp sem start msqElseSTARTP $1Fiecho"Script Execution succeeded! "

Linux Shell Combat (IPCS tools)

Related Article

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.