Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [zsh] Extracting Informations from strings



On Mon, 21 Jun 2004, Stefan [iso-8859-1] ReichЖr wrote:

> Date: Mon, 21 Jun 2004 09:02:44 +0200
> From: "Stefan [iso-8859-1] ReichЖr" <xsteve@xxxxxxx>
> To: zsh-users@xxxxxxxxxx
> Subject: [zsh] Extracting Informations from strings
>
> Hi!
>
> I want to parse the output from acpi:
>   Battery 1: charging, 95%, charging at zero rate - will never fully charge.
>
> I want to extract the "95%" from the output above.
>
> How can I achieve this from within zsh?

  # print "Battery 1: charging, 95%, charging at zero rate - will never fully charge." |  cut -d, -f2
   95%
  #

-- 
artur penttinen



Messages sorted by: Reverse Date, Date, Thread, Author