Hamilton Laboratories ▷ Hamilton C shell 2012 ▷ User guide ▷ Samples

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