From 8e5d5925254ea60ce487ba8660d99c7a50481ea6 Mon Sep 17 00:00:00 2001 From: "chris_friesen@sympatico.ca" Date: Wed, 19 Nov 2003 02:39:39 -0800 Subject: [PATCH] [PATCH] faster test scripts I've attached a patch against 005 for both the block and tty scripts. I didn't bother running udev backgrounded, since as you say, the new code runs a lot faster. --- test/test.block | 5 ++--- test/test.tty | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/test.block b/test/test.block index 622a6603..b806a42a 100644 --- a/test/test.block +++ b/test/test.block @@ -16,14 +16,13 @@ export ACTION=$1 # 'add' or 'remove' for i in ${SYSFSDIR}/block/*; do # add each drive - export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-` + export DEVPATH=${i#${SYSFSDIR}} $BIN block # add each partition, on each device for j in $i/*; do if [ -f $j/dev ]; then - export DEVPATH="/"`echo $j | \ - cut --delimiter='/' --fields=3-` + export DEVPATH=${j#${SYSFSDIR}} $BIN block fi done diff --git a/test/test.tty b/test/test.tty index d5e2d671..42f46a2e 100644 --- a/test/test.tty +++ b/test/test.tty @@ -15,6 +15,6 @@ BIN=./udev # location of your udev binary export ACTION=$1 # 'add' or 'remove' for i in ${SYSFSDIR}/class/tty/*; do - export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-` + export DEVPATH=${i#${SYSFSDIR}} $BIN tty done -- 2.39.5