On Mon, Mar 23, at 07:12 Dan Nicholson wrote:
> On Fri, Mar 20, 2009 at 4:44 PM, Bruce Dubbs <[email protected]> wrote:
>
> If you were looking at a system (not just a computer system) and you
> found that one part took twice the resources and twice as long to
> start up as another part offering similar functionality, why would you
> dismiss it?
In a perfect world? You have to adopt the best technology.
But in the case of Linux, Bash is the single most sacred piece of code.
Objectively, Dash is more suitable for login and system scripts than Bash,
because is faster, more stable and offers portability and compliance with
POSIX specifications, which is very important in a project like ours.
> Maybe the original part offers better features than the
> replacement, but that doesn't mean the other facts can be ignored.
And in the case of interactivity, Zsh offers an unquestionable superior
technology than any other existing shell.
But again, if the purpose of Bash is to write scripts for administrative
tasks, in my opinion and if a script is going to be more that few lines of
code, is much better to write it in one of the popular and portable scripting
languages, like Python and Ruby (even Perl!), rather than to rely on Bash
extensions.
As a side note, and speaking for the future of shell.
In my opinion, (the) shell nowadays has reached its limits and honestly
its not that appealing to the young generation (I don't know for you but
for me the latter is really crucial).
This mostly happens, because a young kid which invests some of his valuable
time (just to be a little productive with the shell), needs to learn a
series of commands, with its own syntax and idiosyncrasy (sometimes really
complex), and then to chain them via pipes (for more complex tasks).
Most of the times this is ugly, fragile and sometimes the result is
unexpected, though through experience this way can be truly efficient (I
am not denying it).
Count on this that most kids are familiar with languages with excellent
syntax (like Python) or beautiful syntax (like Ruby's).
For what? Just to work in a resource hog, ugly and plain slow bloating
environment like Bash.
And try to compare with a shell concept, where everything (directories
and files) are plain objects and you just send messages (applying
methods) to those objects.
What we take is consistent syntax (no matter the kind of operations you
apply), and a powerful language in our disposal with almost no limitation.
E.g., (an example from a Ruby based experimental shell concept named Rush)
dir = home['somedir/']
dir['*.txt'].each {|f| f.destroy}
> >> The last time I tested, it shaved like 4 seconds off boot using dash
> >> instead
> >> of bash.
> >>
> >> http://linuxfromscratch.org/pipermail/lfs-support/2008-February/034192.html
> >
> >> I use bash all the time and I wouldn't consider using a minimal posix shell
> >> for my login shell.
I am very pleased by using Dash as my login shell for more than six months
now. As usual there is no really a scientific benchmark to compare the
differences other than the system is using much lower system resources
and more responsive since all the processes are spawning from Dash.
As interactive shell is not so useful if you don't combine it with an
extensive usage of regular expressions. Line editing is working but there
is no support for multibyte characters so its rather useless in that regard
(although personally, I am mostly using vim scripting for the most usual
tasks (Vim-7 version introduced dictionaries and lists (modeled by Python)
which are really powerful data types)).
> 4 seconds out of 18 total is something I consider very significant.
> For you, maybe it's not, but you are free to keep /bin/bash as
> /bin/sh. However, you agree that the bootscripts are simple, so why do
> you need to use bash again?
>
> Let's just forget about it. I think this is the second or third time
> we've had this conversation and I think we just say the same things
> back and forth.
Yes, this came up a few times and there is no reason to repeat
ourselves. I think the consensus was that following established standards
is the way to go, so there isn't any real argument left for using Bash
for login scripts.
However if this is not going to happen, which is quite possible, I would
prefer to use #!/bin/bash rather than #!/bin/sh in our scripts.
Keep /bin/sh for only POSIX compliant scripts.
If e.g., there is an array used, then make the shebang /bin/bash.
Ugly but much more honest than use /bin/sh in that case and all they
we'll be pleased.
Oh well, almost all. I'd rather get rid of Bash (thank god I am not a
religious).
> Dan
Regards
Ag.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page