Macでlzhな圧縮ファイルを解凍する

とある書籍のサンプルコードの解凍をしようと思ったらlzh形式だったのでメモ

GUIを使うとき

The Unarchiver – Dag Agren」がいい模様

CUIを使うとき

lhaコマンドを利用する模様

<br />
$ brew install lha</p>
<p>==&gt; Downloading http://dl.osdn.jp/lha/22231/lha-1.14i-ac20050924p1.tar.gz<br />
######################################################################## 100.0%<br />
==&gt; ./configure --prefix=/usr/local/Cellar/lha/1.14i-ac20050924p1 --mandir=/usr/local/Cellar/lha/1.14i-ac20050924p1/share/man<br />
==&gt; make install<br />
🍺 /usr/local/Cellar/lha/1.14i-ac20050924p1: 4 files, 148K, built in 21 seconds<br />

<br />
$ lha --help<br />
LHarc for UNIX V 1.02 Copyright(C) 1989 Y.Tagawa<br />
LHx for MSDOS V C2.01 Copyright(C) 1990 H.Yoshizaki<br />
LHx(arc) for OSK V 2.01 Modified 1990 Momozou<br />
LHa for UNIX V 1.00 Copyright(C) 1992 Masaru Oki<br />
LHa for UNIX V 1.14 Modified 1995 Nobutaka Watazaki<br />
LHa for UNIX V 1.14i Modified 2000 Tsugio Okamoto<br />
Autoconfiscated 2001-2005 Koji Arai<br />
usage: lha [-][] [- ...] archive_file [file...]<br />
commands: [axelvudmcpt]<br />
options: [q[012]vnfto[567]dizg012e[w=</p>
<p>&lt;dir&gt;|x= ]]<br />
long options: --system-kanji-code={euc,sjis,utf8,cap}<br />
--archive-kanji-code={euc,sjis,utf8,cap}<br />
--extract-broken-archive<br />
--help<br />
--version<br />
commands: options:<br />
a Add(or replace) to archive q{num} quiet (num:quiet mode)<br />
x,e EXtract from archive v verbose<br />
l,v List / Verbose List n not execute<br />
u Update newer files to archive f force (over write at extract)<br />
d Delete from archive t FILES are TEXT file<br />
m Move to archive (means &#039;ad&#039;) o[567] compression method (a/u/c)<br />
c re-Construct new archive d delete FILES after (a/u/c)<br />
p Print to STDOUT from archive i ignore directory path (x/e)<br />
t Test file CRC in archive z files not compress (a/u/c)<br />
g Generic format (for compatibility)<br />
or not convert case when extracting<br />
0/1/2 header level (a/u/c)<br />
e TEXT code convert from/to EUC<br />
w=&lt;dir&gt;specify extract directory (x/e)<br />
x= eXclude files (a/u/c)<br />
``````<br />
$ lha e &lt;解凍したいファイル&gt;<br />

Windowsの時はLhaplusとかUniversal Extractorとか使ってたけど、
MacになってからLZH形式扱うことがなかったので調べる良いきっかけになりました

ではでは〜