Why questions don't get answered, or "No, I've already RTFM, tell me the answer!"
lesmikesell at gmail.com
Sat Dec 31 02:17:32 UTC 2005
On Fri, 2005-12-30 at 18:52, Mike McCarty wrote:
> > Most of the things you might
> > want to do are already handled nicely by programs included
> > with the system. If you only know a low-level tool like
> > C, you are doomed to re-invent a lot of things unnecessarily.
> Not at all. I just don't glue them together with long complicated
> shell scripts.
> I'm not against anyone learning how to use all the tools available
> to do the things they do best. And not all languages are equally
> suited to any given task. Using the shell as a programming language
> is undesirable for a number of reasons, among them are
> (1) it unnecessarily complicates the command line parser. Since the
> CLI gets sooo much use it is desirable to make it simple, hence
The same things are equally useful for all command line
operations. Scripting isn't a special case.
> (2) Shell scripts are inherently less portable between systems
> than languages designed with portability in mind, like C.
I think portability means something different to you than
it does to me. I don't expect to have a compiler everywhere
I might want to execute a sequence of commands. I do
program1 | program2 | program3 >file_or_device
to work on all the machines I'm likely to use and to be
a lot simpler than figuring out how to do that in C on
> (3) Each part of a system should do the things it does best. I
> find that when I need something relatively complicated, but
> not enormously complicated, often a program written in more
> than one language is best. I use the shell to process the
> directory tree, and use the tools available where I can,
> but if I need special processing then I write a one-off
> C program to do the specialized processing, which gets called
> perhaps like this:
> $ find /path/to/somewhere -name "file*globbing*stuff*" -print |
> my_special_program \;
That's a reasonable approach, especially if my_special_program
does something no one else has needed to do. On the other
hand, if it is a text substitution or similar operation, you'd
find an assortment of tools already available.
> I might even use a loop or two in the shell stuff.
> But I do *not* do the complicated logic using the shell.
In many cases where complicated logic would be required,
programs already exist to perform it, so you can base
the shell operations on that program's results.
lesmikesell at gmail.com
More information about the fedora-list