Function test_and_copy
-teste si fichier/dossier existe et le copie sur la destination
This commit is contained in:
19
isfolder.sh
Executable file
19
isfolder.sh
Executable 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"
|
||||
Reference in New Issue
Block a user