摘要:
function中的变量默认是global,必须显式加关键字 local 才能定义为局部变量 #!/bin/bash function f1() { b=88888 } function f2() { echo $b } f1 f2 #!/bin/bash function f1() { local 阅读全文
摘要:
Usage函数 function Usage() { cat <<-delimiter Usage: command [-x] [-v] [-z] [files] A short explanation of the operation goese here It might be a few li 阅读全文
摘要:
$ echo $- himBH 1、himBH这个结果又是什么意思? 2、看不懂,求第69行详解。多谢++ for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" els 阅读全文
摘要:
1、bash的POSIX标准 在一般的linux系统当中(如redhat), 使用sh调用执行脚本相当于打开了bash的POSIX标准模式 (等效于bash的 --posix 参数) 一般的,sh是bash的“子集” (不是子集的部分,具体区别见下的“Things sh has that bash 阅读全文