Advertisement
devinteske

gunzip-dpv -- gunzip with a TUI/GUI

Aug 20th, 2015
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/bin/sh
  2. [ "${LC_ALL:+set}" ] || export LC_ALL=en_US.ISO8859-1
  3. while [ $# -gt 0 ]; do
  4. FILE="$1" shift
  5. [ -f "$FILE" ] || continue
  6. [ "$FILE" != "${FILE%.gz}" ] || {
  7. echo "ERROR: $FILE does not end in \`.gz'" >&2
  8. exit 1
  9. }
  10. SIZE=$( stat -f%z "$FILE" )
  11. export FILE
  12. dpv -wmx 'zcat > "${FILE%.gz}"' "$SIZE${SIZE:+:}$FILE" "$FILE" || exit
  13. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement