Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot extract with just the extension #2

Open
Zedespook opened this issue Oct 26, 2019 · 1 comment
Open

Cannot extract with just the extension #2

Zedespook opened this issue Oct 26, 2019 · 1 comment

Comments

@Zedespook
Copy link

Zedespook commented Oct 26, 2019

This is how it should be:
(with > unar 797590\ Seven\ Lions\ -\ Summer\ Of\ The\ Occult\ \(1\).osz)

797590 Seven Lions - Summer Of The Occult (1).osz: Zip
  Seven Lions - Summer of the Occult (Alphabet) [Divine Empire of the Supernatural].osu  (54665 B)... OK.
  audio.mp3  (8174159 B)... OK.
  drum-hitclap.wav  (129500 B)... OK.
  drum-hitfinish.wav  (762982 B)... OK.
  drum-hitnormal.wav  (354434 B)... OK.
  drum-slidertick.wav  (117804 B)... OK.
  normal-hitclap3.wav  (129500 B)... OK.
  normal-hitclap4.wav  (104124 B)... OK.
  normal-hitfinish2.wav  (762982 B)... OK.
  normal-hitfinish4.wav  (762982 B)... OK.
  normal-hitfinish5.wav  (762982 B)... OK.
  normal-hitnormal2.wav  (377984 B)... OK.
  normal-hitnormal3.wav  (377984 B)... OK.
  normal-hitnormal5.wav  (377984 B)... OK.
  normal-hitwhistle3.wav  (354434 B)... OK.
  normal-hitwhistle4.wav  (354434 B)... OK.
  normal-sliderslide2.wav  (44 B)... OK.
  normal-slidertick3.wav  (44 B)... OK.
  soft-hitnormal.wav  (40664 B)... OK.
  soft-hitnormal2.wav  (40664 B)... OK.
  soft-hitwhistle.wav  (354434 B)... OK.
  superrrrrrrrrrrrrrrrrrr.png  (1398944 B)... OK.
Successfully extracted to "797590 Seven Lions - Summer Of The Occult (1)".

This is how it is when I only specify the extension:
(with > unar *.osz)

797590 Seven Lions - Summer Of The Occult (1).osz: Zip
No files extracted.

Can someone help me out?

@ssokolow
Copy link

ssokolow commented Sep 21, 2021

That's pretty standard behaviour for command-line archivers. Tools like unzip and 7z behave the same way.

Note the synopsis from unar' manpage:

unar [OPTION]... ARCHIVE [FILE]...

The shell expands wildcards before unar even sees them and, if more than one thing matches *.osz, then the ones after the first one get interpreted as the [FILE] arguments which filter for which files to extract.

If you had a.osz, b.osz, and c.osz in the same folder, then unar *.osz would become unar a.osz b.osz c.osz before being fed to unar and unar would interpret that as "Extract b.osz and c.osz from inside a.osz".

The workaround is to use this instead:

for X in *.osz; do unar "$X"; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants