#!/bin/bash
file=/usr/ras/$1
if [ -f $file ]
then
echo "$file is exist"
exit 0
else
echo "$file is not exist"
if [ -f /home/cie/pkg/ras/$1 ]
then
echo "/home/cie/pkg/ras/$1 is exist"
cp /home/cie/pkg/ras/$1 /usr/ras/
else
echo "/home/cie/pkg/ras/$1 is not exist"
exit 2
fi
exit 1
fi
第一次写shell
最新推荐文章于 2025-11-25 16:48:30 发布
本文介绍了一段使用bash脚本实现的自动配置文件管理流程,包括检查文件是否存在、复制文件以及处理不存在文件的场景。
97万+

被折叠的 条评论
为什么被折叠?



