summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-05-11 02:22:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-05-11 02:22:00 +0000
commit0b6a47691e8ae979ec0009d903bc3d9aabf5a82e (patch)
tree3395867acbeeee2b2ff98e3fbb5ceb908d1a89f0 /etc
parentb9e35614301584da544c574d116772e56bac12e0 (diff)
hex () and kill awk
Diffstat (limited to 'etc')
-rw-r--r--etc/etc.pmax/MAKEDEV35
1 files changed, 26 insertions, 9 deletions
diff --git a/etc/etc.pmax/MAKEDEV b/etc/etc.pmax/MAKEDEV
index 2ba5b4849eb..52fb0551431 100644
--- a/etc/etc.pmax/MAKEDEV
+++ b/etc/etc.pmax/MAKEDEV
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: MAKEDEV,v 1.12 1997/04/23 20:39:04 gvf Exp $
+# $OpenBSD: MAKEDEV,v 1.13 1997/05/11 02:21:59 deraadt Exp $
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
#
@@ -34,6 +34,20 @@
PATH=/sbin:/bin/:/usr/bin:/usr/sbin
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
@@ -60,9 +74,8 @@ std)
mknod stdout c 7 1 ; chmod 666 stdout
mknod stderr c 7 2 ; chmod 666 stderr
mkdir fd > /dev/null 2>&1
- (cd fd && eval `echo "" | awk ' BEGIN { \
- for (i = 0; i < 64; i++) \
- printf("mknod %d c 7 %d;", i, i)}'`)
+ n=0
+ (cd fd && while [ $n -lt 64 ]; do mknod $n c 7 $n; n="$(( $n + 1 ))"; done)
chown -R root.wheel fd
chmod 555 fd
chmod 666 fd/*
@@ -199,11 +212,15 @@ pty*)
case $class in
0|1|2|3|4)
umask 0
- eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
- for (i = 0; i < 16; i++)
- printf("mknod tty%s%x c 4 %d;" \
- "mknod pty%s%x c 5 %d; ", \
- n, i, b+i, n, i, b+i); }'`
+ 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
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0