• 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: Martin Orpen <email@hidden>
  • Date: Wed, 21 Sep 2005 07:27:49 +0100

on 21/9/05 04:21, Bruce Robertson at email@hidden wrote:

>> Martin.
>>
>> Your code works wonderfully in Terminal but it won't compile on any of my
>> Macs in Script Editor.  All choke on the % sign and give the same error:
>>
>> Syntax error
>> Expected """ but found unknown token
>>
>> Any thoughts on why?  It looks to me like the % is escaped correctly and all
>> the quotes line up.
>
> Nope, needs another backslash
>
> set getfs to "df -h / | awk '/\\%/ { print $5 }'"
> do shell script getfs

Or none at all:

set getfs to "df -h / | awk '/%/ { print $5 }'"
do shell script getfs

I escaped the % on the cli version because I assumed it needed escaping. It
doesn't. Awk works either way in the cli but AS doesn't.

Regards

--
Martin Orpen


 _______________________________________________
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

References: 
 >Re: Search for a character (From: Bruce Robertson <email@hidden>)

  • Prev by Date: Re: Search for a character
  • Next by Date: Re: Getting info back from iCal: missing values ?
  • Previous by thread: Re: Search for a character
  • Next by thread: Entourage question
  • Index(es):
    • Date
    • Thread