Function test_and_copy

-teste si fichier/dossier existe et le copie sur la destination
This commit is contained in:
2019-11-08 08:08:29 +01:00
parent 60d06da8df
commit bfa67e5aed

19
isfolder.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/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"