Advertisement
Wyvern67

Type1

Nov 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. _________________________________________ Moi ___________________________________________
  2. #!/bin/sh
  3. fichiers=0
  4. for i in $(ls -A); do
  5.     ligne=$(ls -A -l $i)
  6.     premieresLettres=${ligne:0:2}
  7.     #parfois ça marche parfois non, voir type2.sh
  8.      
  9.     if [ "$premieresLettres" = "-r" ]
  10.     then
  11.         fichiers=$(expr $fichiers + 1)
  12.         echo $i
  13.     fi
  14. done
  15. echo $fichiers
  16. exit 0
  17.  
  18. _________________________________________ Lui ___________________________________________
  19. #!/bin/sh
  20. # One line to rule them all
  21. OUT="`find . -maxdepth 1 -type f -exec sh -c "cat '{}' 2>&1 > /dev/null" \; -exec basename {} \;`"
  22. echo "$OUT\n"
  23. echo "Nombre de fichiers:" `echo "$OUT" | wc -l`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement