The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Enterprise Unix Roundup: The Ghost of Unix Future - Server Watch iBot UNIX and Linux RSS News 0 12-19-2007 12:20 PM
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 05: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 07:57 AM
Unix Sco Open Server, Windows Computers Problem Access Unix Shared Files Help!!!!! haggo Filesystems, Disks and Memory 2 08-23-2006 11:39 AM
Unix History Question: Why are filenames/dirnames case sentsitive in Unix? deckard UNIX for Dummies Questions & Answers 3 03-26-2005 01:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-23-2008
MartyIX MartyIX is offline
Registered User
  
 

Join Date: May 2008
Posts: 68
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)
  #2 (permalink)  
Old 06-23-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,420
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 04:47 PM..
  #3 (permalink)  
Old 06-23-2008
MartyIX MartyIX is offline
Registered User
  
 

Join Date: May 2008
Posts: 68
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.
  #4 (permalink)  
Old 06-23-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,420
The BSD part, for Sys V you have to digg for yourself.
  #5 (permalink)  
Old 06-24-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
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
  #6 (permalink)  
Old 06-24-2008
MartyIX MartyIX is offline
Registered User
  
 

Join Date: May 2008
Posts: 68
Thank you very much
Closed Thread

Bookmarks

Tags
linux, solaris

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:38 PM.


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