CCL Home Page
Up Directory CCL README.unix
> From chemistry-request@ccl.net Sat Apr 15 13:15:08 1995
From: "Dr. Daniel L. Severance" 
Message-Id: <9504150954.ZM9918@sage.syntex.com>
Date: Sat, 15 Apr 1995 09:54:56 -0700
To: CHEMISTRY@ccl.net
Subject: CCL:PSI88: rpsi2 if, Indigo2


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			dan@sage.syntex.com
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 chemistry-request@ccl.net Sat Apr 15 16:28:57 1995
From: Dongchul Lim 
Subject: CCL:PSI88: rpsi2 if, Indigo2
To: chemistry@ccl.net (Computational Chemistry),
        dan@sage.Syntex.Com (Dan Severance)
Date: Sat, 15 Apr 95 16:09:45 EDT


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.

Modified: Sat Apr 15 16:00:00 1995 GMT
Page accessed 6082 times since Sat Apr 17 22:02:12 1999 GMT