需求:
linux shell脚本实现检查指定目录下是否存在对应文件
脚本:
file.sh
#!/bin/bash
if [ -f /root/logback.sh ];then
echo "File exists"
fi
验证:
[root@logstash ~]# sh file.sh
File exists
[root@logstash ~]#
需求:
linux shell脚本实现检查指定目录下是否存在对应文件
脚本:
file.sh
#!/bin/bash
if [ -f /root/logback.sh ];then
echo "File exists"
fi
验证:
[root@logstash ~]# sh file.sh
File exists
[root@logstash ~]#