summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2010-05-05 10:38:44 +0200
committerDan Horák <dan@danny.cz>2010-05-05 10:38:44 +0200
commit4b599b2266a806665d08fca816e43e3587fc26ba (patch)
treea33158956f8b31d3bf6bf7b10c64d5205c80f176
parentabbff789ae244412df43f14c5542eca8b6a8fc8d (diff)
downloadutils-4b599b2266a806665d08fca816e43e3587fc26ba.tar.gz
utils-4b599b2266a806665d08fca816e43e3587fc26ba.tar.xz
utils-4b599b2266a806665d08fca816e43e3587fc26ba.zip
replace seq with a while cycle
Cecause the seq utility lives in /usr/bin and the script must be runnable without the /usr filesystem mounted, it's replaced by a while cycle.
-rw-r--r--device_cio_free14
1 files changed, 10 insertions, 4 deletions
diff --git a/device_cio_free b/device_cio_free
index 80e9451..7aed42b 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -14,7 +14,7 @@
#
# also processes the system ccw config file and network interface configurations
#
-# requires: echo, sleep, modprobe, grep, printf, seq.
+# requires: echo, sleep, modprobe, grep, printf.
#
# it is used in
# anaconda
@@ -132,18 +132,24 @@ wait_on_devices()
IFS=$OLD_IFS
# iterate thru all devices
- for i in $(seq $L0 $U0); do
+ i=$L0
+ while [ $i -le $U0 ]; do
[ $i -eq $L0 ] && LJ=$L1 || LJ=0
[ $i -eq $U0 ] && UJ=$U1 || UJ=3
- for j in $(seq $LJ $UJ); do
+ j=$LJ
+ while [ $j -le $UJ ]; do
[ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0
[ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535
- for k in $(seq $LK $UK); do
+ k=$LK
+ while [ $k -le $UK ]; do
wait_on_single_device "$(printf %x.%x.%04x $i $j $k)"
+ k=$(($k + 1))
done
+ j=$(($j + 1))
done
+ i=$(($i + 1))
done
done
}