Advertisement
Xioth

Bash - TD1 - supprTempo.sh

Jan 25th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ $# -ne 1 ]
  4. then
  5.     echo "Ce programme accepte 1 et 1 seul argument."
  6.     exit 1
  7. fi
  8.  
  9. if [ -d $1 ]
  10. then
  11.     fichiers=$(ls $1)
  12.     for f in $fichiers
  13.     do
  14.         if echo $f | grep -q "~"
  15.         then
  16.             rm $1/$f
  17.         fi
  18.     done
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement