if ( " $shortROI " =~ *" $argv[$ac] "* ) then
...
endif
Example:
set list = (foo bar baz)
foreach a ($*)
if(" $list " =~ *" $a "*) then
echo "$a in list"
else
echo "$a NOT in list"
endif
end
This may incorrectly return true if either the variable on the right side or any of the words from the list contain spaces. If you can decide on a character which cannot appear in either side (eg. @), you can replace the spaces with it in each word:
foreach a ($*:q)
if(" $list:q:gas/ /@/ " =~ *" $a:q:as/ /@/ "*) then
...