On Friday, November 23, 2001, at 04:59 pm, Ondra Cada wrote:
> Well, this can be sured by using
>
> % alias rewrap sed -e '...the well known stuff...'
I suppose what I'm saying here is that I see an alias as a sort of local
kluge that tailors your shell, whereas a standalone script is a tool that'
s independent of any particular environment. There's something snide and
sneaky about the former, and something worthy and noble about the latter..
. :-)
> I personally prefer having my sed scripts in text files, since they are
> more
> easily maintained. That is, of course, just a personal preference.
Me too, but more so. Rather than doing "sed -f <some script>" I prefer a
single entity that does "sh script calling sed", which is what I use at
the moment. But I was looking to take it further, and instead of having
to evoke the shell to evoke sed, just doing "sed -e <some script>" as an
executable. Which you can do, but you can't start adding comments to it.
In awk you can do:
#!/usr/local/bin/awk -f
# lovely comments explaining what the script ought to do
# (even if it doesn't)
<bunch of awk code>
...and once you make that executable you have a nice piece of
self-contained programming that can travel all over the place and still
remain intact.
> I must say I don't know the details of interpretation #! in scripts that
> well. I guess the problem is that sed can't interpret a script if it goes
> in
> without -f; the idea might be _QUITE_ wrong though!!!!
In awk you do use -f (see above) but awk's intelligent enough to
understand this switch as introducing local code if its in a #! opening
line.
> CB> Does TextEdit recognise \n in Find? I've never been able to do this.
>
> Well, not as "\n", but as either pasted value, or cmd-e-brought one
> (which I
> would use here), or Alt-Enter it always worked (even in Edit in those nice
> days so far ago ;)) and does still.
Alt-Enter works thus here too. Many thanks for that tip.
> CB> I've found it easier just to clean out Classic and Windows... :-)
> Just
> CB> don't touch 'em, mate.
>
> I'd like to. So far though -- triple alas! -- Classic is the only way how
> to
> get Final Cut Pro and DVD Studio Pro, and windoze are the only way how to
> make and build applications for my Nokia 9210
Yup, it's darned applications that will always tie you down. Why can't we
just have operating systems.... :-)
> (well, we got quite far with
> XSdk to do it in a decent environment, but the late Psion quit got us
> quite
> dry on funds, and that quitted XSdk as well).
I'm not sure Psion is altogether "late", is it? But I know they've
retrenched. Sorry you got bitten.
> At the very least I would _sometimes_ like to have one \n, _sometimes_ two
> of them between paragraphs.
As that's incredibly easy to fix I'd be inclined to leave it to an ad hoc
pipe of a \n\n para file whenever required.
> CB> (BTW, has anyone noticed the very peculiar ideas that Mail.app
> CB> seems to have about breaking lines?)
>
> Nope. I've tried the thing once or twice, and run away. Now I contentedly
> use my old good trusty NeXTStep 3.3 Mail ;)
Mac OS X's Mail.app has got tons better since 10.0, and has some nice GUI
features (for those that like that sort of thing, hurump!). I was using
NeXTStep Mail.App for all my email until this Mac G4 arrived.
--
el bid
|