zsh-users
 help / color / mirror / code / Atom feed
* making shell ignore braces
@ 2006-05-04 10:38 Eric Smith
  2006-05-04 10:42 ` Frank Terbeck
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Smith @ 2006-05-04 10:38 UTC (permalink / raw)
  To: zsh-users

How do I get the shell not to interpret `()' chars, so
$ dial 00 49 (713) 999 999
must pass only the numbers to the dial script.
and not complain
zsh: no matches found: (713)

Thanks

-- 
- Eric Smith


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

* Re: making shell ignore braces
  2006-05-04 10:38 making shell ignore braces Eric Smith
@ 2006-05-04 10:42 ` Frank Terbeck
  2006-05-04 16:18   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Terbeck @ 2006-05-04 10:42 UTC (permalink / raw)
  To: zsh-users

Eric Smith <es@fruitcom.com>:
> How do I get the shell not to interpret `()' chars, so
> $ dial 00 49 (713) 999 999
> must pass only the numbers to the dial script.
> and not complain
> zsh: no matches found: (713)

Hi Eric,
% noglob dial 00 49 (713) 999 999

If you do this all the time add an alias.

Regards, Frank


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

* Re: making shell ignore braces
  2006-05-04 10:42 ` Frank Terbeck
@ 2006-05-04 16:18   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2006-05-04 16:18 UTC (permalink / raw)
  To: zsh-users

On May 4, 12:42pm, Frank Terbeck wrote:
} Subject: Re: making shell ignore braces
}
} Eric Smith <es@fruitcom.com>:
} > How do I get the shell not to interpret `()' chars, so
} > $ dial 00 49 (713) 999 999
} > must pass only the numbers to the dial script.
} > and not complain
} > zsh: no matches found: (713)
} 
} % noglob dial 00 49 (713) 999 999

That's only part of the answer -- as I read it, Eric also wants the
parens to be discarded so that "dial" sees only digits.

The only reasonable way to accomplish that is to create a wrapper
script or function around "dial".  If "dial" is itself a script, it
might be more appropriate to change that script so that it discards
the parens itself, in which case Frank's answer would finish the job.

A wrapper function might look like

  # Use the "function" keyword to avoid conflicts with aliases
  function dial {
    # Strip non-numerics that commonly appear in phone numbers
    command dial "${@//[-+.()]/}"
  }
  alias dial='noglob dial'


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

end of thread, other threads:[~2006-05-04 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-04 10:38 making shell ignore braces Eric Smith
2006-05-04 10:42 ` Frank Terbeck
2006-05-04 16:18   ` Bart Schaefer

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