The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > 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
Enterprise Unix Roundup: The Ghost of Unix Future - Server Watch iBot UNIX and Linux RSS News 0 12-19-2007 08:20 AM
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 02:24 AM
FTP script for sending a file from one unix directory to another unix server director raja_1234 Shell Programming and Scripting 1 11-30-2006 03:57 AM
Unix Sco Open Server, Windows Computers Problem Access Unix Shared Files Help!!!!! haggo Filesystems, Disks and Memory 2 08-23-2006 08:39 AM
Unix History Question: Why are filenames/dirnames case sentsitive in Unix? deckard UNIX for Dummies Questions & Answers 3 03-26-2005 09:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2008
Registered User
 

Join Date: May 2008
Posts: 68
Stumble this Post!
Sys V or BSD derivated UNIX

I read it was possible to distinguish if UNIX system on the machine is derivated from Sys V or BSD. The instruction said:

ps -ef ... is functional on Sys V
ps ax ... is functional on BSD

But since I don't have any UNIX machine (just Linux) I can't tell how I may use this knowledge in my script.

My idea is that ps -ef returns non-zero exit code on BSD and ps ax returns non-zero exit code on Sys V.

Is my idea right?

Thank you

(it's a question rather more theoretical than practical, I need it to school)
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-23-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 568
Stumble this Post!
On BSD both -ef and ax return 0 on exit.
A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code.

Last edited by danmero; 06-23-2008 at 01:47 PM.
Reply With Quote
  #3 (permalink)  
Old 06-23-2008
Registered User
 

Join Date: May 2008
Posts: 68
Stumble this Post!
So that I have to check the error message from ps on BSD to distinguish it from Sys V?

Quote:
A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code.
I know. But I don't know what part of my message made you to write it.
Reply With Quote
  #4 (permalink)  
Old 06-23-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 568
Stumble this Post!
The BSD part, for Sys V you have to digg for yourself.
Reply With Quote
  #5 (permalink)  
Old 06-24-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,099
Stumble this Post!
In theory this might work, but all "real existing" UNIXes are some sort of "best of both worlds" nowadays.

AIX (as well as HP-Ux and as far as i know SunOS) will understand both syntaxes, "ps -ef" as well as "ps caux".

the same goes (in AIX, other UNIX dialects i do not know in-depth) for the printing/queue management subsystem, which is different in SysV and BSD. In AIX both the SysV variant and the BSD variant are understood, because both command groups are only frontends to a AIX-native subsystem, which is different from both.

There are 100%-BSD implementations out there (netBSD and FreeBSD for instance), but i do not know of any pure SysV-implementation that is worth noticing. (SCO? Please, have mercy....). So probably the best real-world-approach is to look into the output of "uname" and decide based on a translation table. Still I'd think that this distinction is merely academic nowadays, for reasons given.

I hope this helps.

bakunin
Reply With Quote
  #6 (permalink)  
Old 06-24-2008
Registered User
 

Join Date: May 2008
Posts: 68
Stumble this Post!
Thank you very much
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux, solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0