Re: A Different Shell Philosophy
- From: "Stachu 'Dozzie' K." <dozzie@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 02:42:05 +0000 (UTC)
On 20.12.2005, Jon Forrest <forrest@xxxxxxxxxxxxxxx> wrote:
> Keith Thompson wrote:
>> Jon Forrest <forrest@xxxxxxxxxxxxxxx> writes:
>
>> So it wouldn't have if statements, loops, etc., but it would have (for
>> exapmle) all the stuff that tcsh has but csh doesn't, plus whatever
>> additional features you can think of to make it "user-friendly".
>
> Exactly.
>
>> It's an interesting idea, but often "user-friendly" is
>> "expert-hostile". I often use simple programming constructs on the
>> command line. For example, in tcsh I might type something like this
>> interactively:
>>
>> foreach file (`find . -type f -name '*.in'`) do
>> if (! -e $file:r) then
>> sed 's/FOO/BAR/' $file > $file:r
>> endif
>> end
>>
>> That's probably near the limit of what I'd be willing to do without
>> writing a script (probably in sh or Perl). I'd hate to lose that
>> capability. You might make easy tasks easy and difficult tasks
>> impossible. I'd prefer to make easy tasks easy and difficult tasks
>> possible.
>
> My point is that the kind of thing you mention can be done
> in virtually every scripting language. Why take the time
> and effort to learn yet another scripting language (e.g. the shell
> scripting language) instead of figuring out how to do it
> in your favorite scripting language, the one you already know?
I saw similar argument at Cow build system's site. Uhm, not Cow, Ant
(Java based, hence association). Why learn new makefile syntax for
another build system when you can use well-known XML?
The answer is simple: because it's more convenient. I'm writting a lot
of Perl and a little of Ruby and Tcl scripts, but I wouldn't use any of
them for iterating through all *.jpg files just for single
`convert $FILE ${FILE%.jpg}.png' on each. Shell is a lot better to do
that because I don't need to add whole Perl's bloat over exec nor to use
temporary variable for storing input and output filename.
>> You seem to be assuming that convenient interactive use and powerful
>> scripting are inconsistent goals. Are you sure that's true?
>
> Like I said in another posting, it's clearly possible to ignore
> the scripting capabilities in an existing shell. My comments
> were a reaction to the article I read about a new shell.
I don't think such shell would have much use. It looks like zsh without
programming language to me.
--
Feel free to correct my English
Stanislaw Klekot
.
- References:
- A Different Shell Philosophy
- From: Jon Forrest
- Re: A Different Shell Philosophy
- From: Keith Thompson
- Re: A Different Shell Philosophy
- From: Jon Forrest
- A Different Shell Philosophy
- Prev by Date: Re: Frepping for CSS Class Names
- Next by Date: Re: Behaviour of the shell (ksh)
- Previous by thread: Re: A Different Shell Philosophy
- Next by thread: Re: A Different Shell Philosophy
- Index(es):
Relevant Pages
|