鈍足ランナーのIT日記

走るのが好きな5流のITエンジニアのブログ。

趣味の範囲は広いけど、どれも中途半端なクソブロガー楽しめるWebアプリを作ってあっと言わせたい。サーバーサイドPerl(Mojolicious)、クライアントサイドVue.js。Arduinoにも触手を伸ばす予定。

cygwinでtreeコマンドのmakeで失敗。treeコマンドをfindで代用

treeコマンドをfindで代用

treeコマンドをcygwinでmakeしたら、こけてしまい対処のしようがなかったので代用する方法をさがしてみた。

$ make
gcc -s -o tree.exe tree.o strverscmp.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lkernel32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -ladvapi32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lshell32
collect2: ld returned 1 exit status
Makefile:74: recipe for target `tree' failed
make: *** [tree] Error 1

ディレクトリ構造、ファイル構造をツリー状に表示

findコマンドで特定のディレクトリ以下を無視する方法

alias tree='find . -type d -name ".svn" -prune -o -type d -name ".git" -prune  -o -type d -print -o -type f -print |sed -ne "1b;s/[^\/]*\//+--/g;s/+--+/|  +/g;s/+--+/|  +/g;s/+--|/|  |/g;p"'