さとうさん
ありがとうございます。

man find を確認しました。
 -exec command {} +
だと、実行回数が減るんですね。
よくできてます。

ありがとうございました。


On 2014年11月04日 17:31, SATOH Fumiyasu wrote:
さとうふみやす @ OSSTech です。

At Tue, 04 Nov 2014 17:13:00 +0900,
TANAKA Hidemune wrote:
以下のようなスクリプトを使って、
allfind.sh
------------------------------------------
#!/bin/bash

find ./ -name "*" -exec grep 2>/dev/null -H "$1" {} \;
------------------------------------------

   find ./ -name "*" -exec grep 2>/dev/null -H "$1" {} +

とすると、もっと効率的で速いですよ。

   find ./ -type f -exec grep -H "$1" {} +

でいいような気も。

   find ./ -type f -exec grep -H -- "$1" {} +

とすればハイフンで始まるパターンも検索可能。



--
■□■□■□■□■□■□■□■□■□■□■□■

 株式会社 田中コンピューターサービス

     代表取締役 田中 秀宗
           TANAKA Hidemune

  本 社 東京都北区滝野川7丁目45番14号
  電 話 03-3576-7272
  FAX 03-3576-7272
  携 帯 090-6187-1418
  E-Mail [email protected]
      http://tanaka-cs.co.jp

■□■□■□■□■□■□■□■□■□■□■□■

--
Unsubscribe instructions: E-mail to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/ja/discuss/
All messages sent to this list will be publicly archived and cannot be deleted

メールによる返信