Pages

lundi 25 avril 2011

test if a file exists

in bash:

if [[ -e file ]]; then
echo 'ok'
else
echo 'not exists'
fi


in tcsh:

if (-e file) then
echo "ok"
else
echo "not exists"
endif

Aucun commentaire:

Enregistrer un commentaire