• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Search for a character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search for a character


  • Subject: Re: Search for a character
  • From: pete boardman <email@hidden>
  • Date: Mon, 19 Sep 2005 18:25:41 +0100

On 19 Sep 2005, at 16:00, Timothy K. Wilkinson wrote:

I'm having a syntax problem with parsing a text string.

I've parsed a line of text into individual words in a variable. The word I want is the only one that contains a "%". However I can't seem to find the right syntax to parse it out.

Since you're using the shell anyway, why not get the information out in the right format first:


df -h / | grep '%' | cut -f 16 -d ' '

Here, 'cut' is a classic Unix command that cuts bits out of lines of files. The output of df appears to be space-delimited, so this is looking for the 16th field. Daft, yes, since it looks more like the 5th field to me, but that was how the old boys used to do it then... :-)

Pete
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Search for a character
      • From: Martin Orpen <email@hidden>
References: 
 >Search for a character (From: "Timothy K. Wilkinson" <email@hidden>)

  • Prev by Date: Re: Check to see if a computer is running....
  • Next by Date: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Previous by thread: Search for a character
  • Next by thread: Re: Search for a character
  • Index(es):
    • Date
    • Thread