Re: To shell or not to shell (was Re: URL Access Redux)
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