• 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: RegExps in AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegExps in AS


  • Subject: Re: RegExps in AS
  • From: "Ihar 'Philips' Filipau" <email@hidden>
  • Date: Sat, 26 Feb 2005 18:12:18 +0100

On 02/21/05 at +0100 Ihar 'Philips' Filipau said this

P.S. And btw "do shell script" cannot pipeline, so it is rather
useless. Running new instance of say perl for 1k of files is just
insane. sed/awk will run faster - but still overall is slow. Silly,
especially when all this *nix stuff is designed to be pipelined.
Command line? - one might easily hit limit on command line length,
which in BSDs (compared to GNU) is set quite low.


Since when doesn't piplining work in do shell scripts? Does on my machine, try this one liner.

do shell script "cat /usr/share/man/whatis.db | grep '([1])' > ~/desktop/UnixCmdRef.txt"

Note that the output of "cat" is piped to "grep" whose output is then redirected to a file on your desktop.


What I meant to say that AS doesn't support I/O by itself - AS needs external application to do that.


AS and shell are not inter-mixable. So you cannot open pipeline to external (Unix) application and a-la expect do the processing. Neither you can send AS output to stdout/stderr where it can be further processed by unix tools.

Something like that (wild imagination):
$ echo Hello World | open /somewhere/aaa.scpt | cat >aaa.scpt.output
is not possible.

And reverse (with mythical "send to filedescriptor" operator & other imaginary stuff):
| set a to file descriptor of shell script "tr A-Z a-z | sed s/a/b/"
| send to a "initial value"
| repeat with line read from a
| if -- whatever
| send to stdout line & "\n"
| end if
| send to a "next item"
| end repeat
isn't possible too.


That's be truly cool. Everything would do whatever it does better: file & text handling in shell scripts, GUI integration in AS.

P.S. This way it would even possible to write little HTTP/1.0 (or FTP) server in AS - for sockets handling using bash.

--
  A civilization is built on what is required of men,
  not on that which is provided for them.
      -- Antoine de Saint-Exupery

_______________________________________________
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: RegExps in AS
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Re: About password fields
  • Next by Date: Re: do shell scripting a "Find"
  • Previous by thread: Re: RegExps in AS
  • Next by thread: Re: RegExps in AS
  • Index(es):
    • Date
    • Thread