shell
不爱工作的码农
不想上班,不想上班,不想上班!!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
获取当前工作目录和脚本文件所在目录
当前工作目录和脚本文件所在目录是不同的,有时候可能会一样,但是这是不同的概念。例如我们有个脚本:/home/test/test.sh我们进入test目录:cd /home/test/,执行./test,那么当前工作目录和脚本文件所在目录都是一样的:/home/test如果我们不是在test目录下执行脚本文件:cd /home,执行./test/test.sh,那么当前工作目录是:/ho...原创 2018-08-15 15:29:37 · 1393 阅读 · 0 评论 -
shell检测文件类型
-a file exists. -b file exists and is a block special file. -c file exists and is a character special file. -d file exists and is a directory. -e file exists (just the same as -a). -f file exists...原创 2018-08-15 15:41:02 · 708 阅读 · 0 评论 -
shell多线程
使用&和wait结合 #!/bin/bashfor ((i=0;i<10;i++));do{sleep 3;echo "sleep"} & #{}内的命令放在后台执行donewait #等待子线程结束原创 2018-08-15 16:32:24 · 632 阅读 · 0 评论
分享