I agree.. Bash is also available on most if not all modern Unix systems I've worked with. If it is not installed by default, it is at least available from the vendor as an optional package.
Also, unless you are using an advanced feature of bash, the scripts will most likely run unchanged in bourne shell. And if you are using an advanced feature, you're probably aware then that you're using something not available in bourne. And of course, if your environment is one that will definitely include bash, then it would be senseless to not take the time to learn it. -Sam -----Original Message----- From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of John Summerfied Sent: Wednesday, October 26, 2005 7:28 PM To: [email protected] Subject: Re: Generating and fstab from list of mounted file systems Rick Troth wrote: > Let's avoid a religeous debate over shells. > > >>Why shouldn't he learn Bash? All the Linux init scripts are in Bash, >>the %pre and %post scripts in RPMs are in Bash, and lots of other system >>management scripts are in Bash, so it seems like it makes more sense to >>learn Bash. > > > This is a Linux discussion, so if we stay within Linux, fine, > let's code for BASH. > > But not all systems have BASH, and on many which do have it > "/bin/sh" is not BASH but some other shell. So if the scripts > are to be at all portable beyond Linux, avoid BASH-isms. > > Working for an ISV, I cannot recount the pain encountered > where KSH was assumed to be universal. Both Solaris and HP have it, > perhaps AIX too (or a work-alike). But along comes Linux where > "/bin/sh" is not KSH (but is BASH! oh my!) and scripts with > K-shell dependency are immediately broken. And there are > other platforms where neither KSH nor BASH are available > (or are optional, and we do not want to burden the customer > with pre-req upon pre-req). > > The cases you cite are all Linux > or might reasonaly assume Linux even where Linux is not explicit. and it's a fair bet that most people here will only ever code for Linux, and further, that most scripts written for Linux maintenance have limited scope for use outside Linux. ISV folk, of course, may have different needs, but those are hardly the most common. The only proprietary Unix I've used is OS X, and that has bash. Many of the programs are different though, including ls, top, ps and those will cause more grief than whether one writes for sh or bash. As someone here observed some time ago, explicity writing bash scripts has the benefit of producing an immediate failure when bash isn't available. Start you scripts #!/bin/bash by all means. -- Cheers John -- spambait [EMAIL PROTECTED] [EMAIL PROTECTED] Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/ do not reply off-list ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
