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

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



On Jan 13,  7:48pm, Carlos Carvalho wrote:
}
} % if [[ $bar == <1-$max> ]] {print in } else {print out}
} zsh: parse error: condition expected: $bar
} 
} Is it illegal to have parameters inside <-> ...?

Yes.  Do it this way:

range='<1-8>'

if [[ $bar == ${~range} ]] {print in} else {print out}



Messages sorted by: Reverse Date, Date, Thread, Author