shell判断当前输入的名称是否为目录(shell学习笔记三)
来源:互联网 发布:720vr全景通 4.5 源码 编辑:程序博客网 时间:2024/06/14 10:42
[root@localhost shell_project]# ll
总用量 24
-rw-r--r--. 1 root root 49 8月 14 11:14 cshu.sh
-rw-r--r--. 1 root root 277 8月 15 15:41 info-df.sh
-rw-r--r--. 1 root root 203 8月 15 16:04 info-mulu.sh
-rw-r--r--. 1 root root 164 8月 15 14:49 info-root.sh
-rw-r--r--. 1 root root 326 8月 14 15:36 read.sh
drwxr-xr-x. 2 root root 6 8月 15 16:04 test
-rw-r--r--. 1 root root 131 8月 14 11:39 weizi.sh
[root@localhost shell_project]# vim info-mulu.sh
#!/bin/bash
#判断输入的名称是否为目录read -t 30 -p "请输入文件名称:" dir
if [ -d "$dir" ]
then
echo "这个是$dir目录"
else
echo "找不到$dir这个目录"
fi
阅读全文
1 0
- shell判断当前输入的名称是否为目录(shell学习笔记三)
- shell脚本判断当前用户是否为root(学习笔记一)
- linux shell 学习之路---test判断是否为目录
- shell中判断当前时间是否为月末的方法
- linux的shell脚本判断当前是否为root用户
- shell 判断文件/目录是否为空
- Shell判断一个目录是否为空
- shell 判断文件/目录是否为空
- 【Linux】shell---判断用户输入的是否为文件
- linux shell判断目录是否为空的函数
- linux shell判断目录是否为空的函数
- linux bash shell 判断目录是否为空的函数
- shell 当前目录检测文件是否为空并删除
- Shell脚本编程-判断当前用户是否为root
- shell判断目录是否存在
- 【Linux Shell】判断输入变量或者参数是否为空
- 【Linux Shell】判断输入变量或者参数是否为空
- shell判断输入变量或者参数是否为空
- 非制冷式红外探测器原理研究(课题总结论文)
- 剑指offer59对称的二叉树
- Android中重复执行动画bug
- saltstack netapi-cherrypy
- 提交新项目到GIt时遇到的两个常见问题
- shell判断当前输入的名称是否为目录(shell学习笔记三)
- java获得项目绝对路径
- Struts2标签库
- 拓扑(TOP)排序
- spring四种依赖注入方式
- 求所有的公约数(除了1,和本身)
- BeanUtils.copyProperties 如果Integer 或Long 为null 默认赋值0
- 利用com.googlecode.libphonenumber注册手机号
- Installation failed with message Failed to establish session. It is possible...