LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-02-2014, 10:22 AM   #16
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492

Then I guess I'll just have to build bash myself with the patch to disable the stupid feature.
 
Old 10-02-2014, 04:16 PM   #17
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I just wanted to mess around with other possibilities and it looks like removing bash and symlinking ksh to bash and sh seems to work ok so far. Doing the same with zsh does NOT. Just an experiment, not to be done on production systems.

My main issue with applying my own patch is that I have to maintain bash by applying the patch for every new release or I'll miss out on other possible fixes.
 
1 members found this post helpful.
Old 10-03-2014, 02:03 PM   #18
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 393

Rep: Reputation: 81
I have great problems with 'dash' (being the default in LinuxMint).
I do extensive scripting, and the friggin' '-e' option has me given up in dispair!!
'bash' uses '-e' to honour escape/backslash sequences, 'dash' shows it as another argument :-(
It drives me batty!!
 
Old 10-03-2014, 02:24 PM   #19
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The '-e' option is the same in all bourne shells that I have seen. "If not interactive, exit immediately if any untested command fails."
 
Old 10-03-2014, 02:48 PM   #20
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Darth Vader View Post
Looking to latest news, seems like that using BASH is something like preserving your money cache right, down, in the middle of your street. At Any Guy Pleasure to Load IT (tm).

Seriously, WE REALLY WE ARE DEPENDENTS ON BASH? There is NO another SHELL able to replace BASH?

Sorry for "bashing", all the best!
How about this?

You should read the first page of the documentation for giggles. Honest.
 
Old 10-04-2014, 08:35 AM   #21
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You know, I keep going back to what I've said before: if it ain't broke, fix it until it is. I think that's the fundamental problem with more than a few pieces of software where the developer(s) continue to enhance something until it becomes if not just unwieldy but so bloated with features that it is unusable.

To my great embarrassment I have done it and I have regretted having done so, particularly when the phone started ringing at 0300.

Some years ago I administered a pair of Perkin-Elmer super mini's. These beasts had to be booted manually on the console and ran a pretty basic operating system. They required 440V 3-phase power and you could heat the building with them. They were, for all practical purposes, about as powerful as your average four function calculator and the happiest day was when they were replaced with a couple of Motorola VME boxes (with 68040 CPU, lots of RAM, lots of disk and SVR4). The important thing being the SVR4 part: that's Unix System V (Linus was still in grade school at the time). I was already a Unix user and administrator and my life got real easy from that point (the user community were also up to speed with Unix so the switchover went smoothly).

The important thing about Unix, then and now, was the philosophy with which Unix was developed; it's in my signature down below here but it bears repeating:
Quote:
Doug McIlroy, the inventor of Unix pipes and one of the founders of the Unix tradition, summarized the Unix Philosophy as follows:

This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

This is usually abridged to "Write programs that do one thing and do it well."
SVR4 like all Unix releases followed that philosophy to the letter: do one thing and do it well.

The Bourne Shell dates from Version 7 and is a shell or command-line interpreter for computer operating systems. That, simply and elegantly, is what a shell program is for and does; that's the definition.

Stephen Bourne developed it at Bell Labs and it is still in use in every Unix and Unix-like system (you know, Linux, OSX, etc., etc.) for the simple reason that it does one thing and does it well.

Or is it?

Well, no. Nowadays, at least on Linux systems, it's a link to BASH (Bourne Again Shell) which runs Bourne shell programs as if it were actual sh as do other shell programs based upon Bourne; e.g., KornShell.

KornShell, ksh, developed at Bell Labs by David G. Korn, is an interactive command language and a high-level programming language. It incorporates the best features of the Bourne shell and C shell (developed by Bill Joy at the University of California) and new features of its own. For example, Mike Veach of Bell Labs contributed the original code for the emacs built-in editor used in the KornShell language and Pat Sullivan, also of Bell Labs, contributed the original code for the vi built-in editor used in the KornShell language. So, you can do command-line editing with either emacs or vi editing codes as you see fit: it's built-in, not an add-on. (This was adapted from Morris I. Bolsky and David G. Korn, The KornShell Command and Programming Language, Acknowledgements and Preface, ISBN 0-13-516972-0.)

Both Bourne and Korn shells have remained pretty much untouched for... well, a long, long time. They work, they do what they're supposed to and that's that.

BASH was developed at arm's length from scratch. The developers had the function that Bourne and Korn shells had but not the source code (on purpose) and did a pretty good job of it (they may have thrown in a little C shell while they were about it too). You may notice, if you haven't got anything else to do, that pretty much all BASH shell programs will run in KornShell and vice versa. The few trials that I've done bear that out but I haven't done enough testing to really say that it's completely true. There are, however, BASH shell programs that will not, for sure, run in KornShell: those are the ones with "GNU enhancements."

Enhancements is a weasel word for additional features. Enhancements are the things that make other things break all too frequently.

Harsh? Nope, not harsh, more of a warning.

A text editor should edit text. Period. It does not need to be a word processor or formatter or beautifier or whatever it just needs to edit text. Likewise, a shell program should also do one thing and do it well. The current flap with BASH appears, at least to me, to be an enhancement that went terribly wrong. All you have to do is ask yourself if a shell program should do what BASH was doing (and the fix for it looks like an engineering kludge to me). For me, your mileage may vary of course, is no, KornShell doesn't do that and neither should BASH (or any other shell program, dammit).

The company that was using the Perkin-Elmer's did FORTRAN programming under contract. The FORTRAN compiler was, pretty much, IBM's FORTRAN IV (we're talking a long time ago stuff here). The Unix boxes came with ANSI standard FORTRAN 66 (and FORTRAN 77) and we had to port the existing code to at least 66. That meant run the compiler and see what broke and the breaks were all vendor enhancements that had to be rewritten, lots of editing and testing and verifying. Took a while, that. That, among other things, is why I will not ever incorporate vendor enhancements in any code I ever write. GNU tends to enhance now and again (I do port things back and forth between Solaris and Slackware and Sun was just a guilty of enhancing here and there as GNU). Write to ANSI or POSIX standards and you're safe.

I tend to stick with KornShell ("real" KornShell that comes with Slackware (and Solaris)), not any of the "variants" of KornShell (dtksh, tksh, oksh, mksh, SKsh, MKS). I've tried a few, one thing doesn't work the way it should and I'm done with it.

So, could you actually default the system to KornShell rather than BASH? I really don't know (I'm going to set up an isolated Slackware 14.1 and try to find out). How much stuff would break, how much screwing around would it take to get 100% reliability? Easy enough to batch edit every shell program and change the #!/bin/bash to #!/bin/ksh, wouldn't have to bother with the #!/bin/sh, though, just symlink /bin/sh to /bin/ksh. Hmm, might be interesting.

But, when Slackware 14.1 becomes 14.2 or 15.0 or whatever you'd just have to do it all over again (and fix whatever doesn't work again).

It turns out to be a conundrum.

Hope this helps some.
 
3 members found this post helpful.
Old 10-04-2014, 10:47 AM   #22
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by tronayne View Post
So, could you actually default the system to KornShell rather than BASH? I really don't know (I'm going to set up an isolated Slackware 14.1 and try to find out). How much stuff would break, how much screwing around would it take to get 100% reliability? Easy enough to batch edit every shell program and change the #!/bin/bash to #!/bin/ksh, wouldn't have to bother with the #!/bin/sh, though, just symlink /bin/sh to /bin/ksh. Hmm, might be interesting.

But, when Slackware 14.1 becomes 14.2 or 15.0 or whatever you'd just have to do it all over again (and fix whatever doesn't work again).

It turns out to be a conundrum.

Hope this helps some.
I haven't found anything broken so far, but I didn't test everything. There's probably something broken, but it is not affecting me right now.
 
Old 10-04-2014, 02:34 PM   #23
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
long time ago i went to replace bash with ash/ksh to see if it can be done

rc.inet1 uses arrays, as does LUKS in rc.S
probably some others do, that i don't use

ash, being a pure bourne shell, does not support the dot operator
ksh comes with its own kill that is different then the GNU one
rc.6 now uses /sbin/killall5, while there are some others do use just kill/killall

there was a thread about this after i did it
yea, https://www.linuxquestions.org/quest...-s-4175507325/
edit: looks like i was corrected there about arrays being a bash thing
i don't think its POSIX thou

Last edited by genss; 10-04-2014 at 02:38 PM.
 
Old 10-04-2014, 02:40 PM   #24
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
It seems pkgtools don't work with ksh.

EDIT:

So now I'll be testing the patch that disables exporting functions in bash.

Last edited by metaschima; 10-04-2014 at 04:26 PM.
 
  


Reply

Tags
another shell?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Using shell command output as input in shell script - how to do? EnderX Linux - Newbie 2 06-30-2010 12:46 PM
[SOLVED] How can I run a command on another shell without changing the current shell? quanba Other *NIX 3 04-05-2010 12:19 PM
How to run root privileged Linux command as normal user via shell shell tcegrid Linux - Newbie 1 06-23-2008 03:38 PM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:33 AM.

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