随笔分类 -  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 阅读全文
posted @ 2022-05-30 09:47 碧水东流至此回 阅读(55) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-08-23 12:01 碧水东流至此回 阅读(44) 评论(1) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-17 17:00 碧水东流至此回 阅读(73) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-16 15:44 碧水东流至此回 阅读(64) 评论(0) 推荐(0)
摘要:CHAPTER 8 Process Handling Process IDs and Job Numbers UNIX gives all processes numbers, called process IDs, when they are created. Job Control Foregr 阅读全文
posted @ 2021-03-15 15:30 碧水东流至此回 阅读(73) 评论(0) 推荐(0)
摘要:Command-Line Processing it separates lines into words, according to delimiters in the environment variable IFS; and it assigns the words to shell vari 阅读全文
posted @ 2021-03-10 09:30 碧水东流至此回 阅读(49) 评论(0) 推荐(0)
摘要: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) 阅读全文
posted @ 2021-03-08 16:03 碧水东流至此回 阅读(82) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-08 13:34 碧水东流至此回 阅读(58) 评论(0) 推荐(0)
摘要:Typed Variables You can set variable attributes with the declare built-in. * Table 6-1 summarizes the available options with declare. Option Meaning - 阅读全文
posted @ 2021-03-08 11:17 碧水东流至此回 阅读(46) 评论(0) 推荐(0)
摘要:for|case|select|while and until Command-Line Options and Typed Variables Command-Line Options Typical UNIX commands have the form command [-options]ar 阅读全文
posted @ 2021-03-04 16:29 碧水东流至此回 阅读(57) 评论(1) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-04 10:54 碧水东流至此回 阅读(70) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-04 10:10 碧水东流至此回 阅读(48) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-03 18:01 碧水东流至此回 阅读(67) 评论(0) 推荐(0)
摘要:Extended Pattern Matching Operator Meaning *(patternlist) Matches zero or more occurrences of the given patterns. +(patternlist) Matches one or more o 阅读全文
posted @ 2021-03-03 11:09 碧水东流至此回 阅读(46) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-03 11:08 碧水东流至此回 阅读(37) 评论(0) 推荐(0)
摘要:Patterns and Pattern Matching wildcard(通配符) Operator Meaning ${variable#pattern} If the pattern matches the beginning of the variable’s value, delete 阅读全文
posted @ 2021-03-03 10:47 碧水东流至此回 阅读(37) 评论(0) 推荐(0)
摘要:To define a function, you can use either one of two forms: function functname{ shell commands} or: functname ( ) { shell commands} You can also delete 阅读全文
posted @ 2021-03-02 09:42 碧水东流至此回 阅读(99) 评论(0) 推荐(0)
摘要:# Table 3-4. Editing mode variables Variable Meaning HISTCMD The history number of the current command. HISTCONTROL A list of patterns, separated by c 阅读全文
posted @ 2021-02-04 10:50 碧水东流至此回 阅读(84) 评论(0) 推荐(0)
摘要:#Special Characters and Quoting Character Meaning See chapter ~ Home directory 1 ` Command substitution (archaic) 4 # Comment 4 $ Variable expression 阅读全文
posted @ 2021-02-02 13:01 碧水东流至此回 阅读(61) 评论(0) 推荐(0)
摘要:: "${LOG_FILE:=/var/log/factory_install.log}" Shell Parameter Expansioin ${parameter:=word} If parameter is unset or null, the expansion of word is as 阅读全文
posted @ 2021-01-06 13:46 碧水东流至此回 阅读(318) 评论(0) 推荐(0)