Advertisement
Xioth

Bash - TD2 - printExtension.sh

Jan 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. fichiers=$(ls)
  4.  
  5. for f in $fichiers
  6. do
  7.     if echo $f | -q grep "\.[[:alpha:]]*"
  8.     then
  9.         extension=$(echo $f | cut -d '.' -f2-)
  10.         echo ".$extension"
  11.     fi
  12. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement