-1

I'm trying to view the contents of a zip archive using an extremely simple regular expression. This works:

rmorton@Rockette:~$ unzip -l Downloads/WeiDU-Linux-236.zip "*/i386/tolower" "*/i386/weidu" "*/i386/weinstall"
Archive:  Downloads/WeiDU-Linux-236.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   135308  2013-11-17 21:48   WeiDU-Linux/bin/i386/tolower
   774816  2013-11-17 21:47   WeiDU-Linux/bin/i386/weidu
   130392  2013-11-17 21:48   WeiDU-Linux/bin/i386/weinstall
---------                     -------
  1040516                     3 files

But this does not:

rmorton@Rockette:~$ unzip -l Downloads/WeiDU-Linux-236.zip "*/i386/(tolower|weidu|weinstall)"
Archive:  Downloads/WeiDU-Linux-236.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
---------                     -------
        0                     0 files

What gives? Do I have a misunderstanding of how regular expressions work on the command line, or am I missing something obvious?

  • 1
    Thats not regular expression. – DisplayName Dec 14 '14 at 17:02
  • 1
    I understand this must seem like a stupid question to someone with more experience. But what's the point of a site like this if I can't ask novice questions without being downvoted? I read man unzip several times and didn't realize it didn't support the full range of pattern symbols used by most command line utilities. Again, it was a novice mistake. But should it be downvoted? – David Kennedy Dec 14 '14 at 17:23
  • I didn't downvote. – DisplayName Dec 14 '14 at 18:38
  • @DisplayName I didn't assume you did :) – David Kennedy Dec 16 '14 at 4:14
5

Read the man page of unzip. It doesn't talk about regular expressions, just about the two special characters * and ?.

  • 1
    These are often called wildcards or globbing characters (though the latter is more shell-related). – HalosGhost Dec 15 '14 at 0:11
0

You can use -LL option for forcing conversion of every filename to lowercase, regardless of the originating file system

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.