zsh-workers
 help / color / mirror / code / Atom feed
* Wildcards in path question
@ 1997-02-11  1:27 Clint Olsen
  1997-02-11 16:11 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Olsen @ 1997-02-11  1:27 UTC (permalink / raw)
  To: zsh-workers

Hello:

Thanks for your help getting wildcards in my path.  I was wondering how I
might be able to use them so that they are added to my path iff they
existed.  We have a very heterogenous environment here and certain
directories (like /opt) exist on some of the machines.  Otherwise, the
non-existence causes the expansion to barf out.  I'd rather it fail
silently somehow to allow the sourcing of my environment to continue.

Thanks,

-Clint


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

* Re: Wildcards in path question
  1997-02-11  1:27 Wildcards in path question Clint Olsen
@ 1997-02-11 16:11 ` Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1997-02-11 16:11 UTC (permalink / raw)
  To: Clint Olsen; +Cc: zsh-workers

Clint Olsen wrote:
>Thanks for your help getting wildcards in my path.  I was wondering how I
>might be able to use them so that they are added to my path iff they
>existed.  We have a very heterogenous environment here and certain
>directories (like /opt) exist on some of the machines.  Otherwise, the
>non-existence causes the expansion to barf out.  I'd rather it fail
>silently somehow to allow the sourcing of my environment to continue.

The NULL_GLOB option causes glob patterns that don't match anything to
expand to nothing, rather than causing an error.  This can be turned on
for a single glob pattern by using the (N) modifier:

path=( "$path[@]" /opt/*/bin(N) )

-zefram


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

end of thread, other threads:[~1997-02-11 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-11  1:27 Wildcards in path question Clint Olsen
1997-02-11 16:11 ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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