Guest User

Untitled

a guest
Feb 10th, 2022
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. while read; do
  2.     # trim the filename
  3.     FILE=$(echo "$REPLY"| sed -e 's/^ *//' -e 's/ *$//')
  4.  
  5.     # check if the file exists
  6.     if [ -f "$FILE" ]; then
  7.         break
  8.     else
  9.         echo "Can't read this file. Please drop a valid one."
  10.         echo "'$FILE'"
  11.     fi
  12. done
  13.  
  14.  
  15. # check if there are EAs
  16. echo ""
  17. LINES=$(xattr -l "$FILE"|wc -l)
  18.  
  19. if [ "$LINES" -eq "0" ]; then
  20.     echo "Can't fix this file"
  21.     echo "There are no extended attributes associated."
  22.     exit 1 
  23. fi
  24.  
  25. # now remove the EAs
  26. echo ""
  27. xattr -c "$FILE" &>/dev/null
  28. echo "You can now open this file in QT7."
  29.  
Advertisement
Add Comment
Please, Sign In to add comment