Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: making shell ignore braces
- X-seq: zsh-users 10213
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: making shell ignore braces
- Date: Thu, 04 May 2006 09:18:26 -0700
- In-reply-to: <20060504104253.GW2668@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060504103843.GA26084@xxxxxxxxxxxx> <20060504104253.GW2668@xxxxxxxxxxxxxxx>
On May 4, 12:42pm, Frank Terbeck wrote:
} Subject: Re: making shell ignore braces
}
} Eric Smith <es@xxxxxxxxxxxx>:
} > 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'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author