Skip to contentSkip to conversation

Need help with acpi event string splitting

DISCUSSION Simon Gerber 1 participant 1 message Sep 9, 2004 ACPI

lore
Share & tools
lore
#0 lore raw

Dear listreaders

I have a minimal default.sh that used to configure what the acpi events do trigger.

#!/bin/sh
# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}
action=${1/*\//}

My problem now is that I would like to extend those filter, but I don't know how. My event that I would like to parse looks like this:
ibm/hotkey HKEY 00000080 00001003

I'd like to have a expression that returns the last for digit if the group corresponds to ibm and action to hotkey. hotkeynr=${???}

I tried to write a pcre but I lack the knowledge or it's not a pcre that 's used here so if someone could point me it would be nice.

Greetings Simon

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php