News for hackers. Stuff that matters.
Re:Use long flags when scripting (2013) by Hello71 on Friday September 18, 2020 @07:45PM (#24522991)

  extract() {
    bsdtar -xf "$1"
  }
you can decompress things which are not files, such as stdin or device files. in addition, your code does not cover *.tar.xz (more common than tar.bz2 nowadays), or lzma, or lz4, or tar.zst, or many many other formats. further, it's not even consistent: bunzip2, gunzip, and unxz remove the input file, but tar, unrar, 7z, and zstd do not.

There are no comments on this comment yet.