Files
shell_scripts/isfolder.sh
Bruno 21 bfa67e5aed Function test_and_copy
-teste si fichier/dossier existe et le copie sur la destination
2019-11-08 08:08:29 +01:00

20 lines
185 B
Bash
Executable File

#!/bin/bash
test_and_copy() {
if [ -d $1 ] ;
then
cp -R $1 $2
fi
}
if [ -f $1 ] ;
then
cp $1 $2
fi
}
folder=$HOME/Documents/2FA
dest=$HOME/Desktop
test_and_copy "$folder" "$dest"