Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to search for a substring in a parameter?
- X-seq: zsh-users 5691
- From: Zefram <zefram@xxxxxxxx>
- To: Carlos Carvalho <carlos@xxxxxxxxxxxxxx>
- Subject: Re: how to search for a substring in a parameter?
- Date: Mon, 13 Jan 2003 18:26:47 +0000
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <15907.432.363150.443412@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15907.432.363150.443412@xxxxxxxxxxxxxx>
Carlos Carvalho wrote:
>I'm trying to see if the value of a parameter contains a given string
>but didn't find an elegant way.
if [[ $parameter == *given_string* ]]; then
# yes
else
# no
fi
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author