• 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: do shell script - quotation marks problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script - quotation marks problem


  • Subject: Re: do shell script - quotation marks problem
  • From: Christopher Nebel <email@hidden>
  • Date: Sat, 18 Dec 2004 22:10:24 -0800

On Dec 18, 2004, at 10:57 AM, Martin Orpen wrote:

on 18/12/04 5:43 pm, Armin Egginger wrote:

only for example:
do shell script " grep Volumename | cut -d "  " -fl"

Why are you using quote marks with cut?

If you want to use a space as a delimiter you'd do something like:

    $ echo 'hello world' | cut -d\  -f1
    hello

You don't have to use quotes, but it's not particularly abnormal. A helpful trick sometimes is to exploit the fact that sh understands both single and double quotes (though they have somewhat different meanings -- read the sh(1) man page for details), so you could also say this:


	do shell script "echo 'hello world' | cut -d ' ' -f1"

No backslashing necessary.


--Chris Nebel AppleScript Engineering _______________________________________________ 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: do shell script - quotation marks problem
      • From: Martin Orpen <email@hidden>
References: 
 >Re: do shell script - quotation marks problem (From: Martin Orpen <email@hidden>)

  • Prev by Date: CURL JPEG to PICT?
  • Next by Date: Re: Set File Creation date
  • Previous by thread: Re: do shell script - quotation marks problem
  • Next by thread: Re: do shell script - quotation marks problem
  • Index(es):
    • Date
    • Thread