![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | 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. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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) |
| Forum Sponsor | ||
|
|
|
|||
|
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. |
|
|||
|
So that I have to check the error message from ps on BSD to distinguish it from Sys V?
Quote:
|
|
|||
|
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 |