From 266947d9ccccff8b2b71d872d486b6b32513c834 Mon Sep 17 00:00:00 2001 From: Rslw Date: Wed, 10 Jun 2015 11:00:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AD=AF?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20ch3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A colon is acceptable as a function name. >`在程式中的函數名稱中,冒號是被許可加入的其中的元素之一。` --- content/ch3.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/ch3.md b/content/ch3.md index 747e6ac..f1445d4 100644 --- a/content/ch3.md +++ b/content/ch3.md @@ -328,6 +328,7 @@ bash$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/games ``` A colon is acceptable as a function name. +>`在程式中的函數名稱中,冒號是被許可加入的其中的元素之一。` ``` :() { From b3e076980360f7cfdd29239d860a225b115bde81 Mon Sep 17 00:00:00 2001 From: Rslw Date: Fri, 12 Jun 2015 00:45:25 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AD=AF?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20ch3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not portable behavior, and therefore not a recommended practice. In fact, more recent releases of Bash do not permit this usage. An underscore _ works, though. >`這是不可移植的作法,因此不推薦這樣的行為。事實上,最近所釋出的Bash版本並不允許這種用法。但使用下劃線「_」即可運作。` A colon can serve as a placeholder in an otherwise empty function. >`在空函數之中,冒號可做為暫駐功能。` --- content/ch3.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/ch3.md b/content/ch3.md index f1445d4..f6c38ea 100644 --- a/content/ch3.md +++ b/content/ch3.md @@ -342,9 +342,10 @@ A colon is acceptable as a function name. # The name of this function is : ``` This is not portable behavior, and therefore not a recommended practice. In fact, more recent releases of Bash do not permit this usage. An underscore _ works, though. - +>`這是不可移植的作法,因此不推薦這樣的行為。事實上,最近所釋出的Bash版本並不允許這種用法。但使用下劃線「_」即可運作。` A colon can serve as a placeholder in an otherwise empty function. +>`在空函數之中,冒號可做為暫駐功能。` ``` not_empty () { From ed75d523a8d6db87acdba772d9f4076c80f8a1d5 Mon Sep 17 00:00:00 2001 From: Rslw Date: Fri, 12 Jun 2015 12:40:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AD=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ch3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A colon is acceptable as a function name. >`冒號可當作函數名稱。` --- content/ch3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/ch3.md b/content/ch3.md index f6c38ea..d52f610 100644 --- a/content/ch3.md +++ b/content/ch3.md @@ -328,7 +328,7 @@ bash$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/games ``` A colon is acceptable as a function name. ->`在程式中的函數名稱中,冒號是被許可加入的其中的元素之一。` +>`冒號可當作函數名稱。` ``` :() { From dc49f2b49195ca395a45606933ea1ff60dda6fa9 Mon Sep 17 00:00:00 2001 From: Rslw Date: Fri, 19 Jun 2015 22:08:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AD=AF?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20ch3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ! reverse (or negate) the sense of a test or exit status [bang]. The ! operator inverts the exit status of the command to which it is applied (see Example 6-2). It also inverts the meaning of a test operator. This can, for example, change the sense of equal ( = ) to not-equal ( != ). The ! operator is a Bash keyword. >`反轉(或否定)測試或退出當前程式狀態的用途[bang]。驚嘆號用作反轉命令,以及其所施加的退出狀態(請參照範例6-2),同時驚嘆號也可反轉操作者的意圖,例如將等於(=)轉為不等於(!=)。驚嘆號是Bash中的關鍵單字。` In a different context, the ! also appears in indirect variable references. >`在不同的內文之中,驚嘆號也出現在間接變數的引用之中。` In yet another context, from the command line, the ! invokes the Bash history mechanism (see Appendix L). Note that within a script, the history mechanism is disabled. >`另一方面,在命令列中,驚嘆號調用Bash的歷史紀錄(請見 Appendix L)。請注意在腳本中,歷史紀錄是無法作用的。` --- content/ch3.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/ch3.md b/content/ch3.md index d52f610..1d53b5f 100644 --- a/content/ch3.md +++ b/content/ch3.md @@ -354,10 +354,13 @@ not_empty () ``` ! reverse (or negate) the sense of a test or exit status [bang]. The ! operator inverts the exit status of the command to which it is applied (see Example 6-2). It also inverts the meaning of a test operator. This can, for example, change the sense of equal ( = ) to not-equal ( != ). The ! operator is a Bash keyword. +>`反轉(或否定)測試或退出當前程式狀態的用途[bang]。驚嘆號用作反轉命令,以及其所施加的退出狀態(請參照範例6-2),同時驚嘆號也可反轉操作者的意圖,例如將等於(=)轉為不等於(!=)。驚嘆號是Bash中的關鍵單字。` In a different context, the ! also appears in indirect variable references. +>`在不同的內文之中,驚嘆號也出現在間接變數的引用之中。` In yet another context, from the command line, the ! invokes the Bash history mechanism (see Appendix L). Note that within a script, the history mechanism is disabled. +>`另一方面,在命令列中,驚嘆號調用Bash的歷史紀錄(請見 Appendix L)。請注意在腳本中,歷史紀錄是無法作用的。` * wild card [asterisk]. The * character serves as a "wild card" for filename expansion in globbing. By itself, it matches every filename in a given directory.