[Pm-utils] various errors in pm/functions

Stefan Seyfried seife at suse.de
Tue Oct 10 09:46:08 PDT 2006


On Tue, Oct 10, 2006 at 12:13:58PM -0400, Peter Jones wrote:
 
> Actually, I'm committing this, instead:
> 
> @@ -62,13 +62,19 @@ run_hooks()
>         [ -f /var/run/pm-suspend ] && . /var/run/pm-suspend
>         rm -f /var/run/pm-suspend
>  
> -       files="/etc/pm/hooks/*"
> +       files="/etc/pm/hooks/*[^~]"
>         if [ "$2" = "reverse" ]; then
> -               files=$(echo $files | awk '{ for (i=NF; i>=1; i--) if ($i !~ /~$/ { print $i } }')
> +               filea=($files)
> +               filen=${#filea[*]}
> +               while [ "$filen" -gt 0 ]; do
> +                       file="${filea[$filen]}"
> +                       [ -x $file ] && $file $1
> +               done
> +       else
> +               for file in $files ; do
> +                       [ -x $file ] && $file $1
> +               done
>         fi
> -       for file in $files ; do
> -               [ -x $file ] && $file $1
> -       done
>  }

even better, yes.
I must have been blind to not see this :-)
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 


More information about the Pm-utils mailing list