[TriLUG] shell script gives error on Sun Sparcstation

jeremyp at pobox.com jeremyp at pobox.com
Wed Aug 29 18:20:33 EDT 2001


On Wed, 29 Aug 2001, Johnston, Walter E, Ii, SOBUS wrote:

> 
> Any reason why this would work in HP unix but not on a Sun?
> 
> 	#!/bin/sh -x   
> 
> 	var="extrapolation"
> 	len=`expr length $var`

You can't do "expr length" on Solaris for SPARC; it's only available on
the x86 version.  Dunno WHY that is a platform-dependent thing, but it
is.  Read "man expr" for more.

Use perl to solve your problems. :)

--Jeremy

-- 
Signature goes here.




More information about the TriLUG mailing list