Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
There are open source versions of ksh. You can run it on Linux (we do). There was an older ksh for OSS called pdksh that acted somewhat differently than the newer ksh and that may be why folks didn't like it.
There are several differences - bash has most of what ksh does and then some extra stuff. A script written to run in ksh would likely run in bash just fine. A lot of the differences deal with math, variables, arrays, functions etc... - bash just seems to have a hell of lot more of this than ksh
One thing that originally kept me from using bash over ksh was that I liked the vi style editing that ksh used by default but not bash. However, you can type "set -o vi" in bash to get that same functionality.
A script written to run in ksh would likely run in bash just fine. A lot of the differences deal with math, variables, arrays, functions etc... - bash just seems to have a hell of lot more of this than ksh
bash isn't always the winner. ksh has some nice useful variable typing that bash doesn't.
... Oi! bash!... where'd my variable go?
What makes this one particularly bad is that the bash code looks like it ought to work. It's only when you understand the underlying semantics of how bash deals with pipelines that you realise why it doesn't.
Because bash runs a pipeline in a sub-shell, you actually have to do it like this
read variable < <(echo wibble)
I prefer ksh in many ways, but I'm sure part of that is because it's what I'm used to being an old timer.
Don't get me wrong. I've liked ksh ever since I first saw back in the early 90s. I was just saying there's a hell of a lot added to bash that doesn't exist in ksh or the posix sh.
I also agree that ksh is available on multiple platforms by default but bash would have to be specifically added. On the flip side though, most Linux distros come with bash and you have to add ksh if you want it.
For most of my scripting what I learned with ksh is sufficient so I do it that way (most of my math I do by piping to bc -l which works in both ksh and bash). However, I've seen enough other examples to let me know that bash can do some fairly sophisticated things of its own that ksh doesn't. The examples show indicate different ways of doing things in bash than ksh but didn't show anything that could be done in ksh that can't be done in bash in some way.