Files
Bash/Arguments-Fichier.sh
T
2026-10-09 07:53:09 +02:00

24 lines
390 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
#
# FONCTIONALITES
# Ce script permet de vérifier la présence d’un fichier
#
# PARAMETRES ENTREES
# - $1 : emplacement et nom du fichier
#
# CODES RETOUR (exit)
# - 0 : fichier existe
# - 1 : fichier n'existe pas
for i in "$@"
do
if [ -f $i ]
then
echo "Le fichier $i existe"
exit 0
else
echo "Le fichier $i n'existe pas"
exit 1
fi
done