The UNIX Forums  

Go Back   The UNIX Forums > OS Specific Forums > BSD
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


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


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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-2005
Registered User
 

Join Date: Jul 2005
Posts: 33
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-08-2005
eugrus's Avatar
Registered User
 

Join Date: Jan 2005
Location: Russia
Posts: 92
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
See the table in this artice http://www.faqs.org/faqs/unix-faq/sh...l-differences/
Reply With Quote
  #3 (permalink)  
Old 08-08-2005
Registered User
 

Join Date: Jul 2005
Posts: 33
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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 03:51 PM.
Reply With Quote
  #4 (permalink)  
Old 08-08-2005
Registered User
 

Join Date: Jul 2005
Posts: 33
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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 12:59 AM.
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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 -7. The time now is 11:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
UNIX Forum Content Copyright ©1993-2008 SilkRoad Asia All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102