for i in $@; do
if [[ $i == "-l" ]]; then
listf=1
fi
done
#testing for -r
for i in $@; do
if [[ $i == "-r" ]]; then
rem=1
fi
done
#case where -l exists
if [ listf -eq 1 ]; then
for i in $@; do
ls ~/Poubelle
done
fi
#case where -r exists
if [ listf -eq 1 ]; then
for i in $@; do
rm ~/Poubelle *
done
fi
#case where -r and -l exist
if [ listf -eq 1 && rem -eq 1 ]; then
for i in $@; do
echo "moving file"
mv $i ~/Poubelle
echo "Le dossier poubelle contient"
ls ~/Poubelle
echo "Removing files"
rm ~/Poubelle
done
else
for i in $@; do
echo "moving file"
mv $i ~/Poubelle
done
fi