Cannot compare argument in if statement in csh/grep command if argument starts with “-“

  If ($argv[1] == �-debug�) then
  Echo �in loop�
  Endif
  

But this is not working. If I modify this code and remove �-�, then it works.

Similarly I am getting problem using grep command also

Grep �-debug� Filename

Can someone please help me on how to resolve these problems.

Finally i found the soln to my problem.

For prob1, i need to use code like

If ("$argv[1]" == �-debug�) then
  Echo �in loop�
  Endif

i.e. $argv[1] should be enclosed in double quotes.

For problem while using grep command, is to use it like

grep '\-debug' filename