#!/bin/bash
cd ./bin
if test -e ./bash
then
echo "file exist"
else
echo "file not exist"
fi
if test -e ./bash -o -e ./notfile
then
echo "at least one file exist"
else
echo "file both not exist"
fi
输出结果:
file exist
at least one file exist