linux判断脚本是否存在
if [ -f "文件名" ];then echo "文件存在"; else echo "文件不存在"; fi
示例:
if [ -f "/cpfs01/shared/workspace_perception/data/RoadStructure/03_dataset/00_lane/02_test/sz_ramp/v4/compress_sample_path.list" ];then echo "文件存在"; else echo "文件不存在"; fi
if [ -f "文件名" ];then echo "文件存在"; else echo "文件不存在"; fi
示例:
if [ -f "/cpfs01/shared/workspace_perception/data/RoadStructure/03_dataset/00_lane/02_test/sz_ramp/v4/compress_sample_path.list" ];then echo "文件存在"; else echo "文件不存在"; fi