LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 08-02-2009, 05:35 PM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Rep: Reputation: 70
Question 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?
 
Old 08-02-2009, 05:37 PM   #2
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
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 .
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.

Last edited by joeBuffer; 08-02-2009 at 05:43 PM.
 
Old 08-02-2009, 05:37 PM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
How dare you bash bash?!?!
 
Old 08-02-2009, 05:45 PM   #4
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by brianL View Post
How dare you bash bash?!?!
Hi Brian,

I knew I'd set the cat among the pigeons with this post, but it nevertheless demands some serious answers!!
 
Old 08-02-2009, 05:47 PM   #5
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
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.
 
Old 08-02-2009, 05:50 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Bash is a good shell...but I'm a ksh script writer

I may be just "splitting hairs" but I like scripting in ksh
 
Old 08-02-2009, 05:52 PM   #7
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
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.
 
Old 08-02-2009, 05:53 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by Completely Clueless View Post
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 View Post
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
 
Old 08-02-2009, 05:54 PM   #9
scottro11
Member
 
Registered: Jun 2009
Location: NYC
Posts: 263

Rep: Reputation: 59
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).
 
Old 08-02-2009, 06:05 PM   #10
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by scottro11 View Post
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.
 
Old 08-02-2009, 06:08 PM   #11
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 08-02-2009, 06:09 PM   #12
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
"Bash is a Russian tractor", "bc is a kludge". What next?
 
Old 08-02-2009, 06:11 PM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by Completely Clueless View Post
bc is a kludge. And an ugly one at that.
That's your very private perception :}
Quote:
Originally Posted by Completely Clueless View Post
A unified solution is called for.
That's your very private belief. :}

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



Cheers,
Tink
 
Old 08-02-2009, 06:15 PM   #14
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by paulsm4 View Post
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.
 
Old 08-02-2009, 06:18 PM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by Completely Clueless View Post
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.

Last edited by Tinkster; 08-02-2009 at 06:19 PM.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
This is crap ... orange400 SUSE / openSUSE 2 01-02-2005 04:14 PM
OH CRAP!!! (/me needs help) Sticktendo Linux - Newbie 5 01-01-2005 04:41 PM
Ah Crap...come on now!!! GmAz Mandriva 7 11-14-2004 11:30 AM
Linspire = Crap, Netzero also = Crap rm6990 General 16 09-20-2004 02:35 AM
Uh.....crap toolshed Linux - General 1 08-18-2001 11:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration