Message-ID: <63f31f1c@news.ausics.net> From: Computer Nerd Kev Subject: Re: Zip list Newsgroups: comp.os.linux.misc References: <87v8jy1xp6.fsf@usenet.ankman.de> <87v8jxytgh.fsf@usenet.ankman.de> User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i686)) NNTP-Posting-Host: news.ausics.net Date: 20 Feb 2023 17:19:56 +1000 Organization: Ausics - https://www.ausics.net Lines: 23 X-Complaints: abuse@ausics.net Path: csiph.com!news.bbs.nz!news.ausics.net!not-for-mail Xref: csiph.com comp.os.linux.misc:37178 Andreas Kohlbach wrote: > My idea was that if unzip discovers a file you try to deflate is not in > ZIP format that it would automatically look into the file and for example > finds out it's 7Z. Then calls 7z, or if not installed recommends it and > aborts. I suggest writing a script that looks at the output of the 'file' command and picks the program based on that. Something like: f="`file \"$1\"`" echo "$f" | grep -q '7z archive data' && p7zip -d "$1" && exit echo "$f" | grep -q 'Zip archive data' && unzip "$1" && exit echo "No program known to decompress: $f" Personally I hardly ever see 7z format archives, and never any pretending to ZIP. Or if I did, then I probably just assumed they'd been corrupted. -- __ __ #_ < |\| |< _#