diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-05-13 16:21:49 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-05-13 16:21:49 +0000 |
commit | 524a297fa307ece34b8398ef11a8af3919d26bc9 (patch) | |
tree | fcce7f620e2620ddfdd61176046e3ef8e4233e0e /etc/etc.amiga | |
parent | 44da929615102979b7b6266bc5f4fc91d7a2d782 (diff) |
Remove printf dep. use hex() instead
Diffstat (limited to 'etc/etc.amiga')
-rw-r--r-- | etc/etc.amiga/MAKEDEV | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/etc/etc.amiga/MAKEDEV b/etc/etc.amiga/MAKEDEV index f005c3778cc..20e46bfba6c 100644 --- a/etc/etc.amiga/MAKEDEV +++ b/etc/etc.amiga/MAKEDEV @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: MAKEDEV,v 1.21 1997/05/13 05:34:48 millert Exp $ +# $OpenBSD: MAKEDEV,v 1.22 1997/05/13 16:21:48 niklas Exp $ # $NetBSD: MAKEDEV,v 1.21 1996/05/19 21:03:49 veego Exp $ # # Copyright (c) 1990 The Regents of the University of California. @@ -94,6 +94,20 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin umask 77 + +hex () +{ + case $1 in + [0-9]) echo -n $1 ;; + 10) echo -n a;; + 11) echo -n b;; + 12) echo -n c;; + 13) echo -n d;; + 14) echo -n e;; + 15) echo -n f;; + esac +} + for i do case $i in @@ -424,13 +438,15 @@ pty*) case $class in 0|1|2|3|4) umask 0 - (i=0; while [ $i -lt 16 ]; do - eval `printf "rm -f tty%s%x; mknod tty%s%x c 4 %d; \ - rm -f pty%s%x; mknod pty%s%x c 5 %d" $name $i \ - $name $i $offset $name $i $name $i $offset` - offset=$(($offset+1)) - i=$(($i+1)) - done) + n=0 + while [ $n -lt 16 ] + do + nam=$name`hex $n` + rm -rf {tty,pty}$n + mknod tty$nam c 4 "$(( $offset + $n ))" + mknod pty$nam c 5 "$(( $offset + $n ))" + n="$(( $n + 1 ))" + done umask 77 ;; esac |