How can I get match with two list variables?

Viewed 11

I'm using csh, How do I write the if condition for the output to be 'e r'? I want to use only one foreach command.

set a = (q w e r t)
set b = (r e)
foreach a ($a)
   if ($a == $b[]) then
      printf "$a\n"
   endif
end
0 Answers
Related