difference between ksh and bsh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting difference between ksh and bsh
# 1  
Old 08-10-2005
difference between ksh and bsh

i am not that techie when it comes to unix. all i know is how to code...

kindly enlighten me regarding the difference between ksh and bsh. we are currently running scripts using ksh... what would be the implications if we need them to run using bsh?

thanks!
# 2  
Old 08-10-2005
Hmm, interesting question. Did you mean bsh or bash?

Or are you looking at bsh as some are using it as being Bourne shell (some distributions are using ksh for root account as default and moving sh to bsh).

Or are you looking for bsh - bean shell (java) ?

You'll need to check which bsh someone is asking you about.
# 3  
Old 08-10-2005
told you i was not techie Smilie

bourne shell vs. korn shell.
# 4  
Old 08-10-2005
Dude, don't worry about it. You probably can code better than many of us here... Smilie
But "Bourne shell" is just a name for the orignal version of the Unix comand intrenpreter, written at AT&T Bell Labs by a guy named Steve Bourne -- hence the name. This was the basic shell provided as part of the UNIX operating system from AT&T (starting with version 7), and since UNIX emerged from AT&T, it became the de facto standard shell. It was designed to be used both as a programming language (an interpreted one), and also as an interactive command interpeter, to accept commands from the user and relay the message to the underlying system (ie, to the kernel). AT&T came out with different versions of Unix (like e.g. MS has Windows 95, than 98, than XP). The shell changed slightly with various versions (like the introduction of job control, e.g.). (UC Berkley was a hotbed for UNIX innovation at this time, and they came out with their own shell, the csh. This made a lot of enhancements for interactive use, making it easier for the user to type commands manually. But don't worry about that for now.)
But then in the early to mid-80's another AT&T employeee, David Korn, decided it was time to really revamp and make some serious enhancements to the UNIX shell. What he came out with has been called the "Korn" shell, to make a distinction with the old "shell", now know as the "Bourne" shell. The Korn shell still exists today as a active product being developed (www.kornshell.com). You can download it for free, and even get its source. But some version of the "Bourne" shell is still shipped with most commercial Unices (found as /bin/sh/).
But keep in mind that AT&T was not "open source". So people from early on were trying to write clones of their software. There are clones of both the Bourne shell, such as ash, and also of the Korn shell, such as pdksh. One could argue that bash is a clone of both ksh and csh, merging many features form both.
But nowadays, when you say "Bourne shell", in most contexts you use it basically to refer to the set of features that were present in the original versions of the shell. Almost all shells available today have more than just this. A large part of this has to do with POSIX, a body who defines standards for what precisely a UNIX shell must be able to do. So many shell creators try to conform to this standard, and if they choose they add more features besides.
So there are many different shells, and some have different emphases, depending on what the author wants to stress in the product. For example, the zsh is really bloated, because it it is geared to be an interative shell -- ie, a shell intended for a human being to enter commands in by hand. So it has a lot of really fancy features to help the user out. Others, like the ash (or Debian's ash called dash) tend to be minimalistic, and opt for small size and fast execution time. These small shell's are geared towards interpreting scripts, and not so much for interactive use.
So to sum, you can view the Korn shell as a super-set of the features availabe in the Bourne shell. But all Bourne-derived shells (i.e, those not in the csh lineage) have the features of the original shell, and so using only those original features in your scripts is good if you want your scripts to be as portable as possible. But in the end, its all pretty much the same language...."Bourne", one might call it....or, because "Bourne" is really the only shell scripting language used actively on Unix, you can just say "Unix shell scripting language", and every one will understand that you mean some dialect of "Bourne". (You could learn to script in the csh language, but no one really uses it, and so it may not be worth your time. Learn the Bourne style programming.)
If you are interested to learn more about Unix shells, search Google for "Unix history" and 'Unux shell history". Like try this site...http://www.phys.ualberta.ca/~gingric...ls/shells.html

Last edited by hadarot; 08-13-2005 at 06:24 AM..
# 5  
Old 08-10-2005
thanks for the help!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ksh to check second time difference between two servers

I am currently setting up a public key authentication between servers. The goal is to get the date via `ssh hostname date` on all the 4 remote servers , put the value in a text file on the central server and compare the date (specifically seconds) for each server date output to check if time is... (7 Replies)
Discussion started by: depam
7 Replies

2. Shell Programming and Scripting

Difference in dates in days (ksh shell)

Hi Guys, Need a small help, how do i get the difference between two dates (in days) in KSH shell My date is in mm/dd/YYYY format, Is there a function to get time stamp from the respective date and time ( mm/dd/yyyy HH:MM:SS) (1 Reply)
Discussion started by: selvankj
1 Replies

3. Shell Programming and Scripting

[Basic Query]bsh script in tcsh shell

I am a beginner (Just 2 days old:o ), i will really appreciate if you can solve my silly queries as below: Lets say i write a script like this #!/bin/bsh clear #to read name from keyboard echo "your name please.." read fname echo "you just entered $fname" exit 0 My environment is... (2 Replies)
Discussion started by: animesharma
2 Replies

4. UNIX for Dummies Questions & Answers

Difference Between executing llike ./myscript.ksh and . ./myscript.ksh

Hi , What is the diffence between executing the script like ./myscript.ksh . ./myscript.ksh I have found 2 difference but could not find the reason 1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in... (5 Replies)
Discussion started by: max_hammer
5 Replies

5. AIX

bsh problem

When I use bsh, and run "set -o vi" show the following error message: $set -o vi -o: 0402-003 A specified flag is not valid for this command. is my bsh problem or bsh use different command to do "set -o vi"? (2 Replies)
Discussion started by: rainbow_bean
2 Replies

6. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

7. SCO

Bsh shell on SCO

I everybody! I am trying to install the bsh shell on a SCO unix and i don't know how. The deal is that i have an old SCO unix running with an old system made with cobol, so it works with shell menus and it use a variety of a shell called bsh (Business Shell) so i search for a package to install... (5 Replies)
Discussion started by: martocapo
5 Replies

8. Shell Programming and Scripting

ksh: difference between $* and $@

Please ignore. I found the answer at: https://www.unix.com/shell-programming-scripting/24557-difference-between.html (1 Reply)
Discussion started by: JamesByars
1 Replies

9. Answers to Frequently Asked Questions

Difference between ksh,bash and different shells.

Hello Everyone, Can someone please tell me the key difference between the different shells availabe i.e. ksh,bash,(i don't know the others ones. :confused: (5 Replies)
Discussion started by: a25khan
5 Replies

10. UNIX for Dummies Questions & Answers

convert from ksh to bsh

How difficult is it to convert from bourn shell to korn shell and visversa. Reason: If someone bombsout or logs out incorrectly the application we are using give the next person to log in the same permissions as the person that bombed out. Therefore createing ownership problems on print files. (2 Replies)
Discussion started by: Boyd Young
2 Replies
Login or Register to Ask a Question