Subject: Re: MAKEDEV is not portable
To: None <port-sparc@netbsd.org>
From: Robert Evans <r.evans@ic.ac.uk>
List: port-sparc
Date: 01/07/1999 10:15:29
> 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.

Yes, I must be missing something here, but doesn't sh still parse
mkdisk_arith() when the function is defined?  E.g.

# uname -sr
SunOS 5.6
# cat xxx.sh
mkdisk_arith() {
  mknod $1 b $2 $(($3 * 16 + $4))
}
mkdisk_expr() {
  mknod $1 b $2 `expr $3 \* 16 + $4`
}
 
unit=0
maj=3
foo=expr

mkdisk_$expr sd${unit}c $maj $unit 2

# sh xxx.sh
xxx.sh: syntax error at line 2: `(' unexpected
# 

Cheers,
Rob