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

Check existence of an element of an array (a FAQ?)



Hi,

please help me with the following:

Is there an elegant way (i.e. without a loop) to
get the following action

Special_Users=('you','me',......)

U='nobody'

if  $U in $Special_Users
  # do something
fi


Many thanks for a hint

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



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