[Grml] Bugreport zshrc+acpi

Kai Wilke kiste at netzworkk.de
Sat Sep 27 00:09:16 CEST 2008


High, high ...
* Frank Terbeck <ft at grml.org> schrieb am [17.09.08 17:24]:
> Michael Prokop <mika at grml.org>:
> > * Kai Wilke <kiste at netzworkk.de> [20080914 11:27]:
> > > found error in /etc/zsh/zshrc of grml-etc-core-0.3.49.
> > > line 948:
> [...]
> > # acpi
> >      Battery 0: Full, 100%
> > # acpi
> >      Battery 0: Discharging, 100%, discharging [...]
> [...]
> > @Frank: what do you suggest? AFAICS we should improve the way
> 
> Okay, well for me acpi just says 'No support for device type:
> power_supply'. 
> 
> Does 'acpi' only output *one* line at all times?
> 
> If I take your output above, we could do this:
> 
> [snip]
> PERCENT=${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]##Battery <->: [^0-9]##, (<->)%*/${match[1]}}
> [snap]

Besser ist die Apostrophe ans Anfang und Ende zu legen.
PERCENT="${${$(acpi 2>/dev/null)}/(#b)[[:space:]]##Battery <->: [^0-9]##, (<->)%*/${match[1]}}"

Setzt ein User die Option setopt sh_word_split ein funktioniert das
ganze nicht mehr.

Output:
battery:6: bad math expression: operator expected at `0: Full,
1...''`

-----------------------------------------------------------------------

alle hash -d ... funktionieren nicht. Nur die Anzeige wenn man in
dem Verz. ist aber nicht Bsp.: doc <enter> und dann ist man in
/usr/share/doc.
zsh: command not found

Mann kann dazu setopt cdable_vars setzen, dann gehts.

-----------------------------------------------------------------------

Da ich glaube das Du Frank viel mit der zsh unter grml zutun hast,
kann ich dir auch mal meine bisherigen Änderungen, Vorschläge,
Erweiterungen per PM schicken. 

Ich habe aber auch noch nicht wirklich alles durch (Zeit) und kann
auch nicht alles testen. Bin jetzt bei den bindkey's angekommen.


mfg Kiste
-- 
#######################################################################
Netzworkk                   grml - Linux Live CD fuer Sysadmins
Kai Wilke                   http://grml.org
kiste at netzworkk.de
http://www.netzworkk.de
http://netzworkk.berlios.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://ml.grml.org/pipermail/grml/attachments/20080927/01ca2d5d/attachment-0003.pgp>


More information about the Grml mailing list