Subject: PSI88: rpsi2 if, Indigo2

From: "Dr. Daniel L. Severance" <[email-masked]>
Date: Sat, 15 Apr 1995 09:54:56 -0700

Hi,
   The problem with the rpsi2 script in PSI88 (originally written on a SUN)
has to do with the lines of the form:
 if ($argv[1] == '-hp') then
when $argv[1] is a switch like "-pk".  For some reason, it doesn't like having
a "-" as the first character in the compare string.  The following form works
fine (I don't know why, it just works) basically adding a space to the
beginning
of both strings:
if (" $argv[1]" == ' -hp') then

   Does anyone know why the Suns and SGIs differ in this respect?

   I have deposited an modified rpsi2 in the incoming directory as
"rpsi2.updated".

   Good luck!
      Dan

-- 
Dr. Daniel L. Severance			[email-masked]
Staff Researcher			Work phone:	(415) 354-7509
Syntex Discovery Research		Home phone:	(415) 969-5818
R6W-002          		        Fax (Work):  	(415) 354-7363
3401 Hillview Ave                       
Palo Alto, CA  94303

---

From: Dongchul Lim <[email-masked]>
Date: Sat, 15 Apr 95 16:09:45 EDT

>    I have deposited an modified rpsi2 in the incoming directory as

If an expression begins with '-' and the next letter is a valid option of
'test', it is assumed that 'test' was omitted at the beginning.
E.g., if you say
	if (-pk == '-pk')
the C shell interpretes it as
	if (test -pk == '-pk').
So, you get a syntax error.
To prevent the C shell from interpreting an expression beginning with '-'
as an expression for 'test', simply quote the expression, like
	if ("-pk" == '-pk')

---
Dongchul Lim, Dept. of Chemistry, Yale Univ.