Skip to main content
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
        ...
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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
        ...
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
        ...
added 31 characters in body
Source Link
user313992
user313992
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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
        ...
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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:

        if(" $list:q:gas/ /@/ " =~ *" $a:q:as/ /@/ "*) then
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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
        ...
added 199 characters in body
Source Link
user313992
user313992
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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:

        if(" $list:q:gas/ /@/ " =~ *" $a:q:as/ /@/ "*) then
if (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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 (" $shortROI " =~ *" $argv[$ac] "*)
   ...
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:

        if(" $list:q:gas/ /@/ " =~ *" $a:q:as/ /@/ "*) then
added 3 characters in body
Source Link
user313992
user313992
Loading
Source Link
user313992
user313992
Loading