Hamilton LaboratoriesHamilton C shell 2012User guideSamples

member.csh

Oregon Coast

member.csh
Previous | Next

#  Determine if first argument word appears somewhere in the list given
#  by the second argument.

#  Copyright (c) 1994-2012 by Hamilton Laboratories.  All rights reserved.
      
proc member ( a, b )
   local i
   foreach i ($b)
      if (a == i) return 1
   end
   return 0
end

member $argv

Previous | Next