Subject: Re: MAKEDEV is not portable
To: Robert Evans <r.evans@ic.ac.uk>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-sparc
Date: 01/06/1999 16:06:15
On Wed, 6 Jan 1999 23:11:43 +0000 
 Robert Evans <r.evans@ic.ac.uk> wrote:

 > > mkdisk_arith() {
 > >   mknod $1 b $2 $(($3 * 16 + $4))
 > > }
 > > mkdisk_expr() {
 > >   mknod $1 b $2 `expr $3 * 16 + $4`
 > > }
 > 
 > This works fine if you pass it to ksh under Solaris, which can handle
 > the arithmetic, but if you are using a shell where you have to use the
 > mknod_expr() version (e.g. SunOS /bin/sh), then I think the shell is
 > going to barf parsing mkdisk_arith(), and so you are no further
 > forward...  :-(
 > 
 > This is probably why pk has to do the extra eval in his version.

Nonono...

you call those shell functions by doing:

mkdisk_$foo ...

and foo is set to "arith" or "expr" depending on which you have to use.

I thought this was pretty obvious from charles' mail :-)

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 940 5942