The problem with that implementation is that it has to fork lots of subshells. I was thinking more along the lines of: mkdisk_arith() { mknod $1 b $2 $(($3 * 16 + $4)) } mkdisk_expr() { mknod $1 b $2 `expr $3 * 16 + $4` } ... sd*) ... mkdisk_$foo sd${unit}c $maj $unit 2 ...