Skip to content

Replace unzip with bsdtar

Johannes Schauer Marin Rodrigues requested to merge staging into main

bsdtar can do the same job as unzip but without all the problems that the unzip CLI comes with. Instead, bsdtar provides an interface which should be familiar to users of GNU tar and has support for long options. Problems with the unzip CLI include:

  • the -v (verbose) option prohibits extraction and just lists the zip file members (analogous to the -t option of tar)
  • but if -v is given without other arguments prints version information
  • by default, unzip applies a filter mangling extracted filenames unless the -^ option is used to override this behaviour
  • unzip treats all arguments (zip filenames and member names) as wildcards. The man page calls them regular expressions but they are just globs.
  • unable to read archives from standard input

For more fun, try to read the unzip man page. Read the man page especially if Acord, AtheOS, Tandem, VMS, Amiga, OS/2, Windows NT or MS-DOS are things you have fond thoughts for.

Merge request reports