Chris,
>>>>>> Chris Bidmead (CB) wrote at Fri, 23 Nov 2001 17:42:22 +0000:
CB> I suppose what I'm saying here is that I see an alias as a sort of local
CB> kluge that tailors your shell, whereas a standalone script is a tool
CB> that' s independent of any particular environment. There's something
CB> snide and sneaky about the former, and something worthy and noble about
CB> the latter.. .. :-)
;)))
CB> >I personally prefer having my sed scripts in text files, since they are
CB> >more
CB> >easily maintained. That is, of course, just a personal preference.
CB>
CB> Me too, but more so. Rather than doing "sed -f <some script>" I prefer a
CB> single entity that does "sh script calling sed", which is what I use at
CB> the moment. But I was looking to take it further, and instead of having
CB> to evoke the shell to evoke sed, just doing "sed -e <some script>" as an
CB> executable. Which you can do, but you can't start adding comments to it.
CB> In awk you can do:
CB>
CB> #!/usr/local/bin/awk -f
CB>
CB> #lovely comments explaining what the script ought to do
CB> #(even if it doesn't)
CB>
CB> <bunch of awk code>
CB>
CB> ....and once you make that executable you have a nice piece of
CB> self-contained programming that can travel all over the place and still
CB> remain intact.
Yep. And as Pete French was the first to point out,
#!/usr/bin/sed -f
# well, it's time to part, buddy:
s/hello/goodbye/
works just as well.
CB> In awk you do use -f (see above) but awk's intelligent enough to
CB> understand this switch as introducing local code if its in a #! opening
CB> line.
It's not awk who's smart enough -- it's shell (or whoever gets the script
and interprets the '#!' line).
CB> Alt-Enter works thus here too. Many thanks for that tip.
Another nice combination's Alt-Tab, with the obvious meaning.
CB> >(well, we got quite far with
CB> >XSdk to do it in a decent environment, but the late Psion quit got us
CB> >quite
CB> >dry on funds, and that quitted XSdk as well).
CB>
CB> I'm not sure Psion is altogether "late", is it?
So far as PDAs and handhelds are concerned, it is. It remains to make
corporate thingies which are even nice (like NetBook or NetPad), but due to
prices kinda lost on the consumer's market :(((
CB> Mac OS X's Mail.app has got tons better since 10.0, and has some nice GUI
CB> features (for those that like that sort of thing, hurump!). I was using
CB> NeXTStep Mail.App for all my email until this Mac G4 arrived.
Indeed? Perhaps I'll try it again ;)
---
Ondra Cada
OCSoftware: [log in to unmask] http://www.ocs.cz
2K Development: [log in to unmask] http://www.2kdevelopment.cz
private [log in to unmask] http://www.ocs.cz/oc
|