Advertisement
Xioth

Bash - TD1 - afficheMinimum.sh

Jan 25th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -eq 0 ]
  4. then
  5.     taille=1024
  6. elif [ $# -eq 1 ]
  7. then
  8.     taille=$1
  9. else
  10.     echo "Ce programme n'accepte qu'un argument au maximum."
  11.     exit 1
  12. fi
  13.  
  14. fichier=$(ls)
  15.  
  16. for f in $fichiers
  17. do
  18.     t=$(ls -l $f | cut -d ' ' -f5)
  19.     if [ $t -gt $taille ]
  20.     then
  21.         echo $f
  22.     fi
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement