Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.os.linux.ubuntu > #197570 > unrolled thread
| Started by | fred flintstone <fred@server.invalid> |
|---|---|
| First post | 2017-11-07 08:53 -0800 |
| Last post | 2017-11-08 05:37 -0500 |
| Articles | 5 — 5 participants |
Back to article view | Back to alt.os.linux.ubuntu
grep'ing a bunch of located files for a word fred flintstone <fred@server.invalid> - 2017-11-07 08:53 -0800
Re: grep'ing a bunch of located files for a word Bit Twister <BitTwister@mouse-potato.com> - 2017-11-07 17:04 +0000
Re: grep'ing a bunch of located files for a word Richard Kettlewell <invalid@invalid.invalid> - 2017-11-07 17:38 +0000
Re: grep'ing a bunch of located files for a word Aragorn <thorongil@telenet.be> - 2017-11-07 18:36 +0100
Re: grep'ing a bunch of located files for a word Chris Ahlstrom <OFeem1987@teleworm.us> - 2017-11-08 05:37 -0500
| From | fred flintstone <fred@server.invalid> |
|---|---|
| Date | 2017-11-07 08:53 -0800 |
| Subject | grep'ing a bunch of located files for a word |
| Message-ID | <f6e6nrF89adU1@mid.individual.net> |
$ locate errno.h /usr/include/errno.h /usr/include/asm-generic/errno.h /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/x86_64-linux-gnu/sys/errno.h ... /usr/src/linux-headers-4.8.0-56/arch/x86/include/uapi/asm/errno.h /usr/src/linux-headers-4.8.0-56/include/linux/errno.h /usr/src/linux-headers-4.8.0-56/include/uapi/asm-generic/errno.h /usr/src/linux-headers-4.8.0-56/include/uapi/linux/errno.h $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial $ How do I grep the located files for EEXIST ? -- fred
[toc] | [next] | [standalone]
| From | Bit Twister <BitTwister@mouse-potato.com> |
|---|---|
| Date | 2017-11-07 17:04 +0000 |
| Message-ID | <slrnp03ptq.qrc.BitTwister@wb.home.test> |
| In reply to | #197570 |
On Tue, 7 Nov 2017 08:53:13 -0800, fred flintstone wrote: > $ locate errno.h > /usr/include/errno.h > /usr/include/asm-generic/errno.h > /usr/include/linux/errno.h > /usr/include/x86_64-linux-gnu/asm/errno.h > /usr/include/x86_64-linux-gnu/bits/errno.h > /usr/include/x86_64-linux-gnu/sys/errno.h > ... > /usr/src/linux-headers-4.8.0-56/arch/x86/include/uapi/asm/errno.h > /usr/src/linux-headers-4.8.0-56/include/linux/errno.h > /usr/src/linux-headers-4.8.0-56/include/uapi/asm-generic/errno.h > /usr/src/linux-headers-4.8.0-56/include/uapi/linux/errno.h > $ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 16.04.3 LTS > Release: 16.04 > Codename: xenial > $ > > How do I grep the located files for EEXIST ? while read -r fn ; do grep EEXIST $fn done < <(locate errno.h)
[toc] | [prev] | [next] | [standalone]
| From | Richard Kettlewell <invalid@invalid.invalid> |
|---|---|
| Date | 2017-11-07 17:38 +0000 |
| Message-ID | <87a7zyat0v.fsf@LkoBDZeT.terraraq.uk> |
| In reply to | #197571 |
Bit Twister <BitTwister@mouse-potato.com> writes: > On Tue, 7 Nov 2017 08:53:13 -0800, fred flintstone wrote: >> $ locate errno.h >> /usr/include/errno.h >> /usr/include/asm-generic/errno.h >> /usr/include/linux/errno.h >> /usr/include/x86_64-linux-gnu/asm/errno.h >> /usr/include/x86_64-linux-gnu/bits/errno.h >> /usr/include/x86_64-linux-gnu/sys/errno.h >> ... >> /usr/src/linux-headers-4.8.0-56/arch/x86/include/uapi/asm/errno.h >> /usr/src/linux-headers-4.8.0-56/include/linux/errno.h >> /usr/src/linux-headers-4.8.0-56/include/uapi/asm-generic/errno.h >> /usr/src/linux-headers-4.8.0-56/include/uapi/linux/errno.h >> $ lsb_release -a >> No LSB modules are available. >> Distributor ID: Ubuntu >> Description: Ubuntu 16.04.3 LTS >> Release: 16.04 >> Codename: xenial >> $ >> >> How do I grep the located files for EEXIST ? > > while read -r fn ; do > grep EEXIST $fn > done < <(locate errno.h) Rather slow and copes poorly with odd filenames. locate -0 errno.h | xargs -r0 grep EEXIST ...should do the job (untested). -- https://www.greenend.org.uk/rjk/
[toc] | [prev] | [next] | [standalone]
| From | Aragorn <thorongil@telenet.be> |
|---|---|
| Date | 2017-11-07 18:36 +0100 |
| Message-ID | <otsqv9$7qj$1@dont-email.me> |
| In reply to | #197570 |
On Tuesday 07 November 2017 17:53, fred flintstone conveyed the following to alt.os.linux.ubuntu... > $ locate errno.h > /usr/include/errno.h > /usr/include/asm-generic/errno.h > /usr/include/linux/errno.h > /usr/include/x86_64-linux-gnu/asm/errno.h > /usr/include/x86_64-linux-gnu/bits/errno.h > /usr/include/x86_64-linux-gnu/sys/errno.h > ... > /usr/src/linux-headers-4.8.0-56/arch/x86/include/uapi/asm/errno.h > /usr/src/linux-headers-4.8.0-56/include/linux/errno.h > /usr/src/linux-headers-4.8.0-56/include/uapi/asm-generic/errno.h > /usr/src/linux-headers-4.8.0-56/include/uapi/linux/errno.h > $ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 16.04.3 LTS > Release: 16.04 > Codename: xenial > $ > > How do I grep the located files for EEXIST ? $ grep 'EEXIST' $(locate errno.h) -- With respect, = Aragorn =
[toc] | [prev] | [next] | [standalone]
| From | Chris Ahlstrom <OFeem1987@teleworm.us> |
|---|---|
| Date | 2017-11-08 05:37 -0500 |
| Message-ID | <otungo$5gd$4@dont-email.me> |
| In reply to | #197572 |
Aragorn wrote this copyrighted missive and expects royalties: > On Tuesday 07 November 2017 17:53, fred flintstone conveyed the > following to alt.os.linux.ubuntu... > >> $ locate errno.h >> /usr/include/errno.h >> /usr/include/asm-generic/errno.h >> /usr/include/linux/errno.h >> /usr/include/x86_64-linux-gnu/asm/errno.h >> /usr/include/x86_64-linux-gnu/bits/errno.h >> /usr/include/x86_64-linux-gnu/sys/errno.h >> ... >> /usr/src/linux-headers-4.8.0-56/arch/x86/include/uapi/asm/errno.h >> /usr/src/linux-headers-4.8.0-56/include/linux/errno.h >> /usr/src/linux-headers-4.8.0-56/include/uapi/asm-generic/errno.h >> /usr/src/linux-headers-4.8.0-56/include/uapi/linux/errno.h >> $ lsb_release -a >> No LSB modules are available. >> Distributor ID: Ubuntu >> Description: Ubuntu 16.04.3 LTS >> Release: 16.04 >> Codename: xenial >> $ >> >> How do I grep the located files for EEXIST ? > > $ grep 'EEXIST' $(locate errno.h) Don't even need the single-quotes :-) I use "vi $(grep -rIl SYMBOLOFINTEREST)" all the time in my projects. The xargs solution, I haven't had a need yet. -- Alas, how love can trifle with itself! -- William Shakespeare, "The Two Gentlemen of Verona"
[toc] | [prev] | [standalone]
Back to top | Article view | alt.os.linux.ubuntu
csiph-web