• 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: To shell or not to shell (was Re: URL Access Redux)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To shell or not to shell (was Re: URL Access Redux)


  • Subject: Re: To shell or not to shell (was Re: URL Access Redux)
  • From: Martin Orpen <email@hidden>
  • Date: Tue, 23 May 2006 11:28:37 +0100

On 23 May 2006, at 08:39, Wayne Melrose wrote:

How does one get the last word of a string as a shell?

get last word of "this is the word i want"   -- applescript

And as a shell...?

Using awk you can choose which word using $n or get the last using $NF:

	echo 'this is the word I want' | awk '{ print $6 }'  --> want

	echo 'this is the word I want' | awk '{ print $NF }'  --> want

AppleScript is easier because you aren't going to have to deal with problems with line feeds/returns like you have to in the shell.

Shell stuff like awk is useful when you are dealing with big text files.

Suggestion: perhaps we should indicate posts which have little or no AppleScript content in the subject line then they can be treated as others treat [OT] messages. Creating a new list doesn't seem like a very good idea to me - we need to stick together ;-)

--
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: To shell or not to shell (was Re: URL Access Redux) (From: Matt Deatherage <email@hidden>)
 >Re: To shell or not to shell (was Re: URL Access Redux) (From: Wayne Melrose <email@hidden>)

  • Prev by Date: Re: To shell or not to shell (was Re: URL Access Redux)
  • Next by Date: Re: A problem with signs
  • Previous by thread: Re: To shell or not to shell (was Re: URL Access Redux)
  • Next by thread: Re: To shell or not to shell (was Re: URL Access Redux)
  • Index(es):
    • Date
    • Thread