The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > BSD
.
google unix.com



BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Differences Sys 5 and BSD RajaRC SUN Solaris 2 07-20-2004 07:11 AM
Differences gcc <-> aCC coredump2003 UNIX for Dummies Questions & Answers 8 01-23-2004 09:49 AM
Differences between SAN and NAS jigarlakhani Filesystems, Disks and Memory 2 11-15-2003 05:09 PM
differences nis nis+ joerg IP Networking 2 06-24-2002 04:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2005
hadarot hadarot is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 33
OpenBSD sh and ksh differences?

Hi,

I am running OpenBSD 3.7, my first attempt with this OS. I noticed that both /bin/sh and /bin/ksh are both really the pdksh. Yet each has its own manpage. I was wondering what are the differences b/w the two programs on OpenBSD. I.e., has the team configured pdksh to function one way if invoked as "ksh", while functionning differntly if invoked as "sh". (Compare GHU bash, which behaves slightly differntly when invoked as "sh".)

Thanks,
  #2 (permalink)  
Old 08-08-2005
eugrus's Avatar
eugrus eugrus is offline
Registered User
  
 

Join Date: Jan 2005
Location: Russia
Posts: 93
See the table in this artice http://www.faqs.org/faqs/unix-faq/sh...l-differences/
  #3 (permalink)  
Old 08-08-2005
hadarot hadarot is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 33
That's not what I was after. But I did find this in OpenBSD's sh man page:

Quote:
NOTES
sh is implemented as a run-time option of pdksh, with only those sh fea-
tures whose syntax or semantics are incompatible with a traditional
Bourne shell disabled. Since this leaves some sh extensions exposed,
caution should be used where backwards compatibility with traditional
Bourne or POSIX compliant shells is an issue.
So it indeed does function like bash, insofar that OpenBSD's modified version of pdksh checks if it has been invoked as "sh" or as "ksh", and adjusts accordingly. The only thing now is determning what presicely are those features that are disabled from their pdksh when it is invoked as sh. They should list them in the man page, but in fact they don't. One feature difference that I have spotted so far is that "sh" mode that does not support (( )) style arithmetic; you have to us let. (Though $(( )) arithmeatic expansion does work in "sh".)

Last edited by hadarot; 08-08-2005 at 07:51 PM..
  #4 (permalink)  
Old 08-08-2005
hadarot hadarot is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 33
Indeed, here is a snippet OpenBSD's code (@ http://www.openbsd.org/cgi-bin/cvswe...bin/ksh/main.c):

Quote:
int
main(int argc, char *argv[])
{
....
....
kshname = *argv;
....
....

/* Check to see if we're /bin/sh. */
if (!strcmp(&kshname[strlen(kshname) - 3], "/sh") ||
!strcmp(kshname, "sh") || !strcmp(kshname, "-sh")) {
Flag(FSH) = 1;
version_param = "SH_VERSION";
}

Last edited by hadarot; 08-12-2005 at 04:59 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This 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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0