Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    See also gzip -v < file > /dev/null to check the compressibility of a file. Commented Jan 11, 2017 at 14:36
  • @StéphaneChazelas not sure if i think it was an improvement. those case statements can easily put noobs off; I certainly never remember how to get them right :-) are case statements inherently more portable since you did it? i see the point when there are more than two cases, but otherwise ...+ Commented Jan 11, 2017 at 16:48
  • 1
    I suppose it's also a matter of taste, but here it's the typical case where you'd want to use a case statement. case is the Bourne/POSIX construct to do pattern matching. [[...]] is ksh/bash/zsh only (with variations). Commented Jan 11, 2017 at 16:55