I am using csh.
Consider an array of arbitrary length:
set array = ( abc def ghi )
I have the following variable
set var = "def"
How can I find $var
in $array
and determine its index value?
I know I could come up with some elaborate loop where I string match each element and keep a running integer variable, $i
, to determine the index value but I want to know if there is a more direct and compact way of doing this.