On Sun, Oct 22, 2006 at 08:14:58AM +0200, Bart Samwel wrote:
> I see, thanks for reporting this! Unfortunately adding the spaces to the 
> beginning and end is somewhat necessary, because otherwise (for 
> instance) the partition /dev/automatic_thingummy will be found using 
> "grep auto". I think the trick would be to do something like:
> 
> if ( (echo -n " " ; echo -n "$PARTITIONS" ; echo -n " ") | grep " $DEV " 
> > /dev/null ) ; then
> 
> Does it work for you that way?

I didn't try, since I found a cleaner way to do the shell wild card expansion.
What do you think? Expansion is postprocessing and all the comparisons
and white space additions are left as they are:

diff -ur laptop-mode-tools-1.32/usr/sbin/laptop_mode 
laptop-mode-tools-1.32-0mcf02/usr/sbin/laptop_mode
--- laptop-mode-tools-1.32/usr/sbin/laptop_mode 2006-10-06 13:07:02.000000000 
+0300
+++ laptop-mode-tools-1.32-0mcf02/usr/sbin/laptop_mode  2006-10-22 
09:58:47.000000000 +0300
@@ -271,6 +271,9 @@
        PARTITIONS="auto /dev/mapper/*"
 fi
 
+# Expand shell wild cards
+PARTITIONS=$( echo $PARTITIONS )
+
 # Convert seconds to hdparm -S format
 # Everything over 20 minutes is interpreted as 2 hours.
 seconds_to_hdparm_S() {


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to