2008-10-09から1日間の記事一覧
「ls」じゃなくて「find」の結果をforで回せばOK。 #!/bin/sh # 第一引数で指定したディレクトリ配下のテキストファイルを一覧表示する。 for file in `find $1 -name "*.txt"`; do echo "$file" done 実行結果です。 $ ./file-list.sh ./ ./b.txt ./c.txt .…
「ls」じゃなくて「find」の結果をforで回せばOK。 #!/bin/sh # 第一引数で指定したディレクトリ配下のテキストファイルを一覧表示する。 for file in `find $1 -name "*.txt"`; do echo "$file" done 実行結果です。 $ ./file-list.sh ./ ./b.txt ./c.txt .…