
shell编程
鶸者为何战斗
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
shell ./ 和 source 运行的区别
用法: source file.sh 或 . file.sh source命令与"."命令相同 source file.sh 与 sh file.sh 及./file.sh执行脚本的区别在那里呢? 1.当shell脚本具有可执行权限时,用sh file.sh与./file.sh执行脚本是没有区别的。./file.sh是因为当前目录没有在PATH中,所有"."是用来表示当前目录的。转载 2017-07-11 09:46:55 · 1230 阅读 · 0 评论 -
shell编程中的一些坑
1、在用getopt接受选项和参数的时候 set -- $(getopt ab:cd $@) while [ -n $1 ] do case $1 in -a);; -b);; esac echo $1 shift done 这个代码根本停不下,根据检查发现在检查变量$1是不是为空的时候,一直是不为空的。在这个判断的时候一定要在变量上加上双引号。 set -- $(getopt原创 2017-07-05 09:45:10 · 320 阅读 · 0 评论