best shell scripting book

Want to know best shell scripting book? we have a huge selection of best shell scripting book information on alibabacloud.com

Shell scripting implements managing multiple servers at the same time

Tags: password read execute command upload file loop bulk upload login service confShell scripting to manage multiple servers at the same time, without the use of ansible, automatic manual implementationSSH does not log on to the Machine execution command (if you have to implement password-free login)ssh 127.0.0.1 ‘ifconfig‘ssh 127.0.0.1 ‘ifconfig|grep bbb‘ssh 127.0.0.1 ‘tail /var/log/secure‘Shell while looping through the IP list of servers that need

Shell implementation of multi-level menu scripting

This article mainly introduces the shell implementation of multi-level menu system Installation script instance sharing, this script with multi-level menu to achieve lamp, LNMP installation display effect, the need for Friends can refer to:Hint: This script mainly realizes multi-level menu effect, and does not install lamp, LNMP environment, if want to use in the actual build environment to deploy LNMP, lamp environment, only need to make a simple mod

Shell Scripting Development Specification

1) Start specifying the script interpreter#!/bin/sh; #!/bin/bash2) opening plus version and copyright information3) No Chinese comments in script4) file saved with. sh extension5) Full-time write-in of paired content to prevent leakage6) [] have spaces at both ends of the brackets7) Process Control statements are completed once, then add statementsHint: You check the script clearly no problem, but is to perform a baffling error, to think of executing the Dos2unix commandGood habit: Each executio

Shell scripting language Operators

In shell programming, operators are essential, and can be said to be used in every script. Familiarity with mastering operators is a basic skill. Comparison operators: eq Equals Ne Not equal to Lt Less than Le Less than or equal Gt Greater than Ge Greater than or equal

LINUX Shell Scripting related

instruction (displays the exit status of the last command. 0 means no error, any other value indicates an error)$-shows the current options used by the shell, same as the SET command function[email protected] is similar to $*, but can be used as an array--------------------------------------------------------------------------------------------------#!/bin/sh##############Export lang= "ZH_CN. GB18030 "Export JAVA_HOME=/USR/LOCAL/JDKExport path= $JAVA

Shell Scripting Learning

program exit representative (typically 0 for execution success, not 0 for execution failure)echo $?--$# represents the number of arguments for the current shell--$* (an entire string) [email protected] (each parameter counts as a string) represents all parameters--$$ PID of the current processCustom variables--The syntax format is: Name=[value]--Note:Variable equals cannot have spaces on either sideVariable is case sensitive--Use ($ variable name) to

Configuration and optimization practices for the Shell Scripting development environment

information such as interpreter and author at the beginning of shell scriptAutocmd bufnewfile *.py,*.cc,*.SH, *.java exec": Call Settitle ()"func settitle ()ifExpand"%:e") =='SH'Call Setline (1,"#!/bin/bash") Call Setline (2,"#Author: Yang Yuanqiang") Call Setline (3,"#Blog1: http://aqiang.blog.51cto.com") Call Setline (4,"#Blog2: http://www.cnblogs.com/ivan-yang/") Call Setline (5,"#Time:". Strftime ("%F%T")) Call Setline (6,"#Name:". Expand ("%"))

The internal variables of shell scripting learning

        Ten$GLOBIGNORE A list of pattern matches for a file name, and if the file matched in the wildcard (globbing) contains a file in the list, the file will be removed from the matching result. $GROUPS This is a list of group IDs (arrays) for the current user, as is the content recorded in the /etc/passwd file. Eleven$HOME User's home directory     Twelve $HOSTNAME 

Shell scripting Exercises (12.11)

("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>Method Two: seq is a fixed notationIdea: 1. First define a variable i2. Let the value of sum first start with the value of 0,i from 1 to 1001.3. Let I equals a number to remove to 2 if equal to 0, is the number we want to let them add together can get the sum neededVim sum2.sh#/bin/bash#written by Lizheng#about sumLet sum=0For I in $ (seq 1 100); DoIf [$[$i%2] = = 0]; ThenLet sum+= $iFiDon

Shell Scripting Learning (iii)

Shell echo CommandDisplay Normal string:echo "I am cat_crazy."Note: The double quotes here can be omittedShow escape characters:If you want to output quotes, the * number needs to be escaped to output, as followsecho \ "I am cat_crazy\"The output is "I'm cat_crazy."Note: Quotes need to be escaped to outputDisplay variables:Name= "Cat_crazy"Echo $nameShow line breaks:Echo-e "Hello \ n" #-e open escape \ n line breakecho "Cat_crazy"The output is:HelloCa

Getting Started with Linux Shell scripting (ii) Looping statements

sundo Echo ' Today is $var 1 ' donefor var2 in {1..10..2}doecho ' this is $var 2 "Donefor Var3 in $ (SEQ 1 2) Doecho" I had a/an $var 3 "Donefor VAR4 in $ (LS) Doecho" Here's the file $var 4 "doneWhile loop#!/bin/bashi=1while ((I SELECT statementThis SELECT statement to the time the wood has seen, run when you can interact with the user, run the following program to understand. If you don't break it, you're going to die.#!/bin/bashecho "which color do you like?" Select Var1 in red Green Bluedoe

Shell scripting Knowledge (c) Regular expressions grep sed awk

.$: Contains the text content of the first field.awk ' {print $} ' filename prints the fifth column.Print permissions and file names for files in the current directory:awk ' {print $ ': ' $9} 'Total-rw-rw-r--.: BsdmakefileDrwxrwxr-x.:config-rw-rw-r--.: config.inDrwxrwxr-x.:d OCSDrwxrwxr-x.:feeds-rw-rw-r--.: Feeds.conf.defaultTo remove a sentence that contains a word in a file:Sed ' s/[^.] *mobile phone[^.] *\ . G ' filenameRemove the sentence that contains the word "mobile phone".The format of t

Shell Scripting Learning Notes (normal form)

Fgrep. These return values make it possible to perform aself-initiated text processing. I used the Egrep tool in the example above. is the extension of grep, a lot of other ways to use this tool and the above introductionSome of the inadequate places you can go to the encyclopedia to find out, in fact, some of the more advanced tools also support this expression. I'll be in the knot.The blog is again introduced.I personally think that the rote of these characters is inappropriate. We should le

8-shell Integer Expression introduction-Practice and enterprise case Scripting anatomy

Integer two-dollar comparison operator The comparer used in [] and test The comparer used in (()) and [[]] Description -eq = = or = Equal abbreviations, equal -ne != Not equal abbreviations, unequal -gt > Greater than greater than -ge >= Greater than or equal to greater equal -lt Less than than similar -le Less than or equal to

Shell Scripting 1

Tags: ret strong expr pts null. sh com bin filedetermine whether a variable is an integer through expr[email protected] scripts]# cat judge.sh#!/bin/bash############################################################### File Name:judge.sh# version:v1.0# Author:rain Jin# Blog site:http://www.cnblogs.com/rainjin/# Created Time:2017-10-27 21:19:42# Environment:centos 7.2 kernal 3.10.0###############################################################judging If the arguments you have entered is integers;If

Shell Scripting Learning notes-integer Two-dimensional comparison operator

Tags: Linux shell1.1 The following table is a common two-dimensional comparison operatorWe can also see through the man testTips(1) The "(2) the ">" symbol is greater than the meaning, if[["$a" > "$b"]], if[["$a" \> "$b"]. You need to escape in parentheses because the shell is also redirected with (3) The "=" symbol equals the meaning, if[["$a" = "$b"]],if[["$a" = "$b"]. Escaping is not required in single [].Special tips:"=" and "! = "use in [] does n

Shell Scripting Learning Notes-string test expressions

1.1 String test operatorThe string test operator has the function of comparing whether two strings are the same, whether the length of a string is zero, whether the string is null (NOTE: Bash distinguishes between 0-length strings and empty strings, etc.)The following table is a common string operatorYou can also view the string test operator with the man testString test operator Hints:(1)-N compares whether the string length is nonzero, or true if nonzero: [-n ' $myvar](2)-Z compares whether st

Shell Scripting-date comparison and judgment

Compare days with 2 dates1. Script referenceScript 1: #!/bin/bash#格式化过期日期,格式化过期日期完整时间以当前时间作为参考!expday="2018-04-11 `date +%T`"echo "Expire day is $expday"#当前日期时间格式为stamp时间戳todays=`date +%s`echo "Today is $(date +"%F %T")"#以下2种方式做时间的四则运算,分别使用 let 或者 $(( ))#过期日期已格式化,规避整数运算的误差(去余数)#let dayDiff=($(date -d "$expday" +%s)-$todays)/86400dayDiff=$(( ($(date -d "$expday" +%s)-$todays)/86400 ))echo "Diff day is $dayDiff days!"Other Notes:Bash does not support floating-point operations, and if floatin

The tenth chapter of the Linux command line and Shell scripting Encyclopedia uses the editor

Previous Edit CommandA: Append data after the current cursorO: The next line of the cursor inserts dataDW Delete a Wordd$ Delete to end of lineDD: Delete Row, 5dd delete 5 rowsThe use of backspace and delete keys in normal mode is not recognized.10.1.4 Copy and pasteDD can be pasted with p after deletion.The copy command is Y,YW copy a wordy$ Copy to end of lineThen use p to paste10.1.5 Find Replacement: s/old/new/g a line command to replace all old, which is replaced only on one line: N,ms/old

Shell scripting exercises for Linux

A. Triangle Square exercise1. Print triangles, method one, regular expressions650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/ea1ad50480c4e888094441dee06b962f.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-34-44.png "alt=" Ea1ad50480c4e888094441dee06b962f.png "/>Method two, loop nestingI control lineJ Control Printing symbols650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/e08401143190fdb2eb60e1ef084e1528.png "style=" float: none; "Title=" screensho

Total Pages: 15 1 .... 11 12 13 14 15 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.