You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
501 B
16 lines
501 B
#!/bin/bash
|
|
|
|
for f in $(ls $1); do
|
|
if [ $(echo "$?") -eq "127" ]; then
|
|
shift
|
|
elif [ $# -eq 0 ]; then
|
|
echo "Aucun arg ou aucun fichier dans ce repertoire" >&2
|
|
fi
|
|
if [ ls -l --time-style +%Y-%m-%d $1/$f | tr -s " " | cut -d " " -f 8 -e ]; then
|
|
cp $f $(ls -l --time-style +%Y-%m-%d $1/$f | tr -s " " | cut -d " " -f 8)
|
|
else
|
|
mkdir $(ls -l --time-style +%Y-%m-%d $1/$f | tr -s " " | cut -d " " -f 8)
|
|
cp $f $(ls -l --time-style +%Y-%m-%d $1/$f | tr -s " " | cut -d " " -f 8)
|
|
fi
|
|
done
|