Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for fisier in *; do
- type=`file $fisier`;
- image=`grep "image" <<< $type &>/dev/null;echo $?`;
- if [[ "$image" -eq "0" ]] ;then
- ext=`echo $type| tr -s ' ' | cut -d " " -f 2 | tr [:upper:] [:lower:]`;
- echo $ext;
- cp "$fisier" "$fisier.$ext";
- fi;
- done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement