Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: how to search for a substring in a parameter?



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