随笔分类 - shell
摘要:#part of the code, inside a function local pending readarray -d $'\0' pending < \ <(find /var/lib/fwupd/pending -type f -size -100c -print0 2>/dev/nul
阅读全文
摘要:Patterns and Pttern Matching We’ll continue refining our solution to Task 4-1 later in this chapter. The next type of string operator is used to match
阅读全文
摘要:CHAPTER 10|bash Administration Installing bash as the Standard Shell # cor@debian:~/shell/mar17$ cat 3.sh IFS=: for d in $PATH;do echo checking $d: cd
阅读全文
摘要:CHAPTER 9|Debugging Shell Programs This chapter looks at some useful features that you can use to debug shell programs.We’ll look at how you can utili
阅读全文
摘要:CHAPTER 8 Process Handling Process IDs and Job Numbers UNIX gives all processes numbers, called process IDs, when they are created. Job Control Foregr
阅读全文
摘要:Command-Line Processing it separates lines into words, according to delimiters in the environment variable IFS; and it assigns the words to shell vari
阅读全文
摘要:Chapter 7 Input/Output and Command-Line Processing I/O Redirectors The redirector <> is mainly meant for use with device files (in the /dev directory)
阅读全文
摘要:Arithmetic Conditionals Operator Meaning -lt Less than -gt Greater than -le Less than or equal to -ge Greater than or equal to -eq Equal to -ne Not eq
阅读全文
摘要:Typed Variables You can set variable attributes with the declare built-in. * Table 6-1 summarizes the available options with declare. Option Meaning -
阅读全文
摘要:for|case|select|while and until Command-Line Options and Typed Variables Command-Line Options Typical UNIX commands have the form command [-options]ar
阅读全文
摘要:Flow Control Exit Status Every UNIX command, whether it comes from source code in C, some other language, or a shell script/function, returns an integ
阅读全文
摘要:Advanced Examples: pushd and popd Task 4-8 The functions pushd and popd implement a stack of directories that enable you to moveto another directory t
阅读全文
摘要:Command Substitution The command inside the parentheses is run, and anything the command writes to standard output is returned as the value of the exp
阅读全文
摘要:Extended Pattern Matching Operator Meaning *(patternlist) Matches zero or more occurrences of the given patterns. +(patternlist) Matches one or more o
阅读全文
摘要:Length Operator(chapter 4, page[117|99]) There is one remaining operator on variables. It is ${#varname}, which returns the length of the value of the
阅读全文
摘要:Patterns and Pattern Matching wildcard(通配符) Operator Meaning ${variable#pattern} If the pattern matches the beginning of the variable’s value, delete
阅读全文
摘要:To define a function, you can use either one of two forms: function functname{ shell commands} or: functname ( ) { shell commands} You can also delete
阅读全文
摘要:# Table 3-4. Editing mode variables Variable Meaning HISTCMD The history number of the current command. HISTCONTROL A list of patterns, separated by c
阅读全文
摘要:#Special Characters and Quoting Character Meaning See chapter ~ Home directory 1 ` Command substitution (archaic) 4 # Comment 4 $ Variable expression
阅读全文
摘要:: "${LOG_FILE:=/var/log/factory_install.log}" Shell Parameter Expansioin ${parameter:=word} If parameter is unset or null, the expansion of word is as
阅读全文
浙公网安备 33010602011771号