LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is Bash crap? (https://www.linuxquestions.org/questions/linux-newbie-8/is-bash-crap-744613/)

Completely Clueless 08-02-2009 05:35 PM

Is Bash crap?
 
Isn't the Bash shell a bit agricultural? I mean, does it not in truth resemble a 1950s Russian tractor? I mean it can't do floating-point math nor a whole bunch of other stuff.
Somewhere someone posted a link to a guide to advanced Bash scripting and it started out by stating what Bash is NOT suitable for. This heading was followed by a *VERY* long list of situations indeed, most of which the remedy for was using C/C++ or Fortran or some other more complete language instead. Shouldn't we all just be writing our scripts in C/C++ and using the tcshell instead?

joeBuffer 08-02-2009 05:37 PM

Bash is used for many things, but it's not used for everything, that's all ... read up on init scripts, and look at yours. Sometimes bash is used for other important things :D.
If you want to replace every bash script on your system with another language, you're welcome to.
I don't see anyone else moving in that direction.

brianL 08-02-2009 05:37 PM

How dare you bash bash?!?! :tisk: :D

Completely Clueless 08-02-2009 05:45 PM

Quote:

Originally Posted by brianL (Post 3628826)
How dare you bash bash?!?! :tisk: :D

Hi Brian,

I knew I'd set the cat among the pigeons with this post, but it nevertheless demands some serious answers!!

joeBuffer 08-02-2009 05:47 PM

No matter how little I know about things, I know enough to know that many other people (all highly intelligent) are also thinking hard about the same things.

custangro 08-02-2009 05:50 PM

Bash is a good shell...but I'm a ksh script writer :)

I may be just "splitting hairs" but I like scripting in ksh :D

brianL 08-02-2009 05:52 PM

I haven't got round to trying the other shells, tcsh, pdksh, and zsh. I'd have to do that before I could criticise bash. If it's used as the default shell on so many distros, it can't be all that bad really.

Tinkster 08-02-2009 05:53 PM

Quote:

Originally Posted by Completely Clueless (Post 3628820)
Isn't the Bash shell a bit agricultural? I mean, does it not in truth resemble a 1950s Russian tractor? I mean it can't do floating-point math nor a whole bunch of other stuff.
Somewhere someone posted a link to a guide to advanced Bash scripting and it started out by stating what Bash is NOT suitable for. This heading was followed by a *VERY* long list of situations indeed, most of which the remedy for was using C/C++ or Fortran or some other more complete language instead. Shouldn't we all just be writing our scripts in C/C++

But that's the whole point of scripting languages, and the Unix
Linux philosophy; many little tools that do one job, and do it
well. You certainly could go and write & compile your init
scripts in C/C++, but do you want to have the tool chain to
build them installed on all your servers? bash (with a little
help from bc) will do the job (maybe a tick slower than a C++
generated executable would have), but then, you don't boot
the server often enough to make that performance benefit worth
the while.
Just because it doesn't do everything for you in its own right
doesn't make it useless. It's still the glue yo can use to get
all the tools in your system to work together.

Quote:

Originally Posted by Completely Clueless (Post 3628820)
and using the tcshell instead?

Why on earth would one want to use THAT piece of crap for scripting?
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/



Cheers,
Tink

scottro11 08-02-2009 05:54 PM

Keeping in mind that part of the principle of Unix is to have many little things do one thing well, I think it more than serves its purpose. For example, to do floating point math you could combine bc with bash. (Or use python, perl, or even zsh actually).

Completely Clueless 08-02-2009 06:05 PM

Quote:

Originally Posted by scottro11 (Post 3628840)
Keeping in mind that part of the principle of Unix is to have many little things do one thing well, I think it more than serves its purpose. For example, to do floating point math you could combine bc with bash. (Or use python, perl, or even zsh actually).

bc is a kludge. And an ugly one at that. A unified solution is called for.

paulsm4 08-02-2009 06:08 PM

Hi -

Quote:

I knew I'd set the cat among the pigeons with this post, but it nevertheless demands some serious answers!!
I disagree that such a (deliberately!) provocative question deserves any kind of serious answer.

However, if you asked the question a bit more politely (like "Gee: why would I want to use 'bash', even though it doesn't support floating point?"), perhaps somebody might have responded with a long list of problems for which bash is the *ideal* solution.

IMHO .. PSM

brianL 08-02-2009 06:09 PM

"Bash is a Russian tractor", "bc is a kludge". What next?

Tinkster 08-02-2009 06:11 PM

Quote:

Originally Posted by Completely Clueless (Post 3628848)
bc is a kludge. And an ugly one at that.

That's your very private perception :}
Quote:

Originally Posted by Completely Clueless (Post 3628848)
A unified solution is called for.

That's your very private belief. :}

Go and code in C++ - you have the freedom.



Cheers,
Tink

Completely Clueless 08-02-2009 06:15 PM

Quote:

Originally Posted by paulsm4 (Post 3628849)
Hi -



I disagree that such a (deliberately!) provocative question deserves any kind of serious answer.

However, if you asked the question a bit more politely (like "Gee: why would I want to use 'bash', even though it doesn't support floating point?")

That's not what I asked. Sadly, Bash has MANY more deficiencies than merely the inability to support floating-point arithmetic.
Please, everyone, get over your blind loyalty and examine the question dispassionately. This is something that could really make a positive difference if actually addressed.

Tinkster 08-02-2009 06:18 PM

Quote:

Originally Posted by Completely Clueless (Post 3628855)
That's not what I asked. Sadly, Bash has MANY more deficiencies than merely the inability to support floating-point arithmetic.
Please, everyone, get over your blind loyalty and examine the question dispassionately. This is something that could really make a positive difference if actually addressed.

Heh. It's just a matter of paradigms. Most of us here (seemingly)
prefer the lego method, whereas you want a ready-made remote control
car. You preference for the latter doesn't make the first bad; it
just means it's not what you want.


Get over it. Stop telling everyone else they have bad taste in toys.



Cheers,
Tink


P.S.: And with these words I'm moving the flame-bait to General, where
it belongs.


All times are GMT -5. The time now is 04:01 AM.