Re:Use long flags when scripting (2013)
by OskarS on Friday September 18, 2020 @02:48PM
(#24520504)
How often do you use gzip verbose? I don't think I've ever used it. What's it good for?
[ Parent
| on HN ]
Personally a fan of '--verbose' to be honest. It's clear. "grep -v" anyone?
Re:Use long flags when scripting (2013)
by frenchy on Friday September 18, 2020 @03:08PM
(#24520730)
Particularly in this case, because `-v` sometimes means "print out the version number".
Re:Use long flags when scripting (2013)
by jfrunyon on Friday September 18, 2020 @03:11PM
(#24520758)
That's why they mentioned `grep -v`. Go look it up. It doesn't mean verbose OR version.
Doubt you'd be printing out a version number in a shell script though.
Re:Use long flags when scripting (2013)
by cogburnd02 on Friday September 18, 2020 @03:52PM
(#24521199)
You may want to compare a version number of a command to make sure it's bigger than (or equal to) the minimum version required by your script, though.
Re:Use long flags when scripting (2013)
by codazoda on Friday September 18, 2020 @04:42PM
(#24521694)
>-v, --invert-match
> Selected lines are those not matching any of the specified patterns.
For the lazy.
Edit: I don't know hackernews formatting and I'm among the lazy, so... Marked as "won't fix".
Re:Use long flags when scripting (2013)
by mattkrause on Saturday September 19, 2020 @11:22AM
(#24528012)
Of all the options, it is so fitting and proper to use the long form for —-verbose.
Re:Use long flags when scripting (2013)
by adrianmonk on Friday September 18, 2020 @03:17PM
(#24520817)
It shows you the percentage reduction in size.
It's rare that I'd use it in a script. Perhaps I'd use it for a script whose main purpose is creating an archive to be widely distributed. Then the info might be of interest to the script's user.
But your comment brings up a good point about the difficulty of deciding what short flags truly are widely known. I assumed anyone who uses gzip regularly would know "-v", but maybe that isn't true.
Re:Use long flags when scripting (2013)
by ryanianian on Friday September 18, 2020 @02:54PM
(#24520568)
It's useful when debugging your artifacts. It's a nice shortcut for adding a `find` after the `tar` invocation. Outside of debugging I've never seen the gzip/tar verbose output as anything other than clutter.