| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-0.8 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_HD,TW_YG,T_TO_NO_BRKTS_FREEMAIL |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <4E7B2D8F.409@gmail.com> |
| Date: | Thu, 22 Sep 2011 14:43:59 +0200 |
| From: | Marco atzeri <marco DOT atzeri AT gmail DOT com> |
| User-Agent: | Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: 'cygcheck -f' pattern syntax. |
| References: | <j5f8io$2uq$1 AT dough DOT gmane DOT org> |
| In-Reply-To: | <j5f8io$2uq$1@dough.gmane.org> |
| X-IsSubscribed: | yes |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
On 9/22/2011 2:10 PM, Oleksandr Gavenko wrote:
> $ time cygcheck -f 'stdio.h'
> real 0m1.016s
> user 0m0.031s
> sys 0m0.015s
> $ time cygcheck -f '*stdio.h'
> $ time cygcheck -f '*stdio.h'
> $ time cygcheck -f '*stdio.h'
> $ time cygcheck -f /usr/include/stdio.h
> cygwin-1.7.9-1
>
> real 0m0.907s
> user 0m0.015s
> sys 0m0.031s
>
> So 'cygcheck -f' does not allow 'glob' and 'regex'.
>
> I write simple script that allow use regex:
>
> #!/bin/sh
>
> regex=$(echo "$1" | sed -e 's|\\|&&|g' -e 's|=|\\=|g')
>
> for file in /etc/setup/*.lst.gz; do
> name=${file#/etc/setup/}
> name=${name%.lst.gz}
> gzip -d -c $file | sed -n "\=$regex={s=^=$name: /=;p;}"
> done
>
> But this script is extremely slow:
>
> $ time ./cygsearch.sh 'bin/emacs'
> emacs: /usr/bin/emacs-nox.exe
> emacs: /usr/bin/emacs.ico
> emacs: /usr/bin/emacsclient.exe
> emacs-X11: /usr/bin/emacs-X11.exe
>
> real 0m38.797s
> user 0m44.620s
> sys 0m25.574s
>
much faster
$ time cp /etc/setup/*.gz .
real 0m1.450s
user 0m0.061s
sys 0m1.202s
$ time gunzip *.gz
real 0m1.937s
user 0m0.170s
sys 0m1.764s
$ time grep -H "stdio.h" *.lst
cygwin.lst:usr/include/stdio.h
cygwin.lst:usr/include/sys/stdio.h
gcc4-core.lst:usr/lib/gcc/i686-pc-cygwin/4.5.3/include/ssp/stdio.h
gcc4-g++.lst:usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/tr1/stdio.h
libboost-devel.lst:usr/include/boost/iostreams/filter/stdio.hpp
libglib2.0-devel.lst:usr/include/glib-2.0/glib/gstdio.h
libhdf5-devel.lst:usr/include/H5FDstdio.h
libicu-devel.lst:usr/include/unicode/ustdio.h
mingw-gcc-core.lst:usr/lib/gcc/i686-pc-mingw32/4.5.2/include/ssp/stdio.h
mingw-runtime.lst:usr/i686-pc-mingw32/sys-root/mingw/include/stdio.h
mingw64-i686-gcc-core.lst:usr/lib/gcc/i686-w64-mingw32/4.5.3/include/ssp/stdio.h
mingw64-i686-gcc-g++.lst:usr/lib/gcc/i686-w64-mingw32/4.5.3/include/c++/tr1/stdio.h
mingw64-i686-headers.lst:usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h
perl.lst:usr/lib/perl5/5.10/i686-cygwin/CORE/nostdio.h
splint.lst:usr/share/splint/lib/stdio.h
real 0m0.816s
user 0m0.046s
sys 0m0.781s
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |