9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rc expression question
@ 2017-03-17 10:20 dexen deVries
  2017-04-01  3:59 ` Skip Tavakkolian
  0 siblings, 1 reply; 2+ messages in thread
From: dexen deVries @ 2017-03-17 10:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

given
pathnames = ( foo/a.txt bar/b.txt baz/c.txt )

how do i construct arguments to test(1) that test for existence of
those files in one go?

wanted:
test -e foo/a.txt -o -e bar/b.txt -o -e baz/c.txt

assuming the pathnames may contain space characters.



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

* Re: [9fans] rc expression question
  2017-03-17 10:20 [9fans] rc expression question dexen deVries
@ 2017-04-01  3:59 ` Skip Tavakkolian
  0 siblings, 0 replies; 2+ messages in thread
From: Skip Tavakkolian @ 2017-04-01  3:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

something like this?

% xxx=`{echo test '-e '^$pathnames^' -o' 1 '!=' 1}
% $xxx


On Fri, Mar 31, 2017 at 5:31 PM dexen deVries <dexen.devries@gmail.com>
wrote:

> given
> pathnames = ( foo/a.txt bar/b.txt baz/c.txt )
>
> how do i construct arguments to test(1) that test for existence of
> those files in one go?
>
> wanted:
> test -e foo/a.txt -o -e bar/b.txt -o -e baz/c.txt
>
> assuming the pathnames may contain space characters.
>
>

[-- Attachment #2: Type: text/html, Size: 1000 bytes --]

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

end of thread, other threads:[~2017-04-01  3:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 10:20 [9fans] rc expression question dexen deVries
2017-04-01  3:59 ` Skip Tavakkolian

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).