9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rc file name matching
@ 2011-02-16 14:56 hugo rivera
  2011-02-16 15:08 ` erik quanstrom
  2011-02-16 15:15 ` Anthony Sorace
  0 siblings, 2 replies; 5+ messages in thread
From: hugo rivera @ 2011-02-16 14:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi,
In rc
*hola*
matches any file that contains the word 'hola'. Is there any way to
match all the files that don't contain 'hola' in its name? with awk
and grep it's easy, but I can't figure out with rc.

--
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc file name matching
  2011-02-16 14:56 [9fans] rc file name matching hugo rivera
@ 2011-02-16 15:08 ` erik quanstrom
  2011-02-16 15:18   ` hugo rivera
  2011-02-16 15:15 ` Anthony Sorace
  1 sibling, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2011-02-16 15:08 UTC (permalink / raw)
  To: 9fans

On Wed Feb 16 09:59:31 EST 2011, uair00@gmail.com wrote:
> Hi,
> In rc
> *hola*
> matches any file that contains the word 'hola'. Is there any way to
> match all the files that don't contain 'hola' in its name? with awk
> and grep it's easy, but I can't figure out with rc.

match=()
for(i in *)
	! ~ $i *hola && match = ($match $i)

- erik



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc file name matching
  2011-02-16 14:56 [9fans] rc file name matching hugo rivera
  2011-02-16 15:08 ` erik quanstrom
@ 2011-02-16 15:15 ` Anthony Sorace
  2011-02-16 15:28   ` hugo rivera
  1 sibling, 1 reply; 5+ messages in thread
From: Anthony Sorace @ 2011-02-16 15:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

I hadn't thought of erik's answer. I usually end up doing something
like "cat `{ls | grep -v hola}" or the like. I find that easier to read,
unless you're really restricted to literally using just rc for some reason.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 210 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc file name matching
  2011-02-16 15:08 ` erik quanstrom
@ 2011-02-16 15:18   ` hugo rivera
  0 siblings, 0 replies; 5+ messages in thread
From: hugo rivera @ 2011-02-16 15:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks Erik.

2011/2/16 erik quanstrom <quanstro@labs.coraid.com>:
> On Wed Feb 16 09:59:31 EST 2011, uair00@gmail.com wrote:
>> Hi,
>> In rc
>> *hola*
>> matches any file that contains the word 'hola'. Is there any way to
>> match all the files that don't contain 'hola' in its name? with awk
>> and grep it's easy, but I can't figure out with rc.
>
> match=()
> for(i in *)
>        ! ~ $i *hola && match = ($match $i)
>
> - erik
>
>



-- 
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc file name matching
  2011-02-16 15:15 ` Anthony Sorace
@ 2011-02-16 15:28   ` hugo rivera
  0 siblings, 0 replies; 5+ messages in thread
From: hugo rivera @ 2011-02-16 15:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I am not restricted to rc only. I was doing something similar to you,
but then it occurred to me that perhaps there was an easy way to do it
with rc; apparently there isn't ☺

2011/2/16 Anthony Sorace <a@9srv.net>:
> I hadn't thought of erik's answer. I usually end up doing something
> like "cat `{ls | grep -v hola}" or the like. I find that easier to read,
> unless you're really restricted to literally using just rc for some reason.
>
>



-- 
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-16 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-16 14:56 [9fans] rc file name matching hugo rivera
2011-02-16 15:08 ` erik quanstrom
2011-02-16 15:18   ` hugo rivera
2011-02-16 15:15 ` Anthony Sorace
2011-02-16 15:28   ` hugo rivera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).