Detect Operating System


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Detect Operating System
# 8  
Old 02-19-2013
Check the below links for more information.

pSeries and AIX Information Center

ps
# 9  
Old 02-19-2013
Hi.

See also the 1500-line GNU shell script config.guess at http://git.savannah.gnu.org/gitweb/?....guess;hb=HEAD

Best wishes ... cheers, drl
# 10  
Old 02-19-2013
uname is sufficient for shell commands like df and ps.
For inventory etc. you want uname -sm
The case statement can be used like this:
Code:
#!/bin/sh
os=`uname -s`
model=`uname -m`
case "$os $model" in
"SunOS sun4u") echo "Solaris on SPARC";;
"SunOS i86pc") echo "Solaris on x86";;
"HP-UX 9000/800") echo "HP-UX on PA-RISC";;
"HP-UX ia64") echo "HP-UX on Itanium";;
"Linux x86_64") echo "Linux on x86, 64bit";;
"Linux i686") echo "Linux on x86, 32bit";;
AIX*) echo "AIX on $model";;
FreeBSD*) echo "FreeBSD on $model";;
*) echo "$os on $model";;
esac

ps -ef works on all operating systems but BSD. BSD needs ps auxw. Linux takes both.
For cross-reference, book-mark this: http://bhami.com/rosetta.html
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

What's my Operating System

Can we know the operating given the IP address or DNS of the host. All I have is file://myserver/myapp (4 Replies)
Discussion started by: mohtashims
4 Replies

2. UNIX for Advanced & Expert Users

Best Operating System

Hello All, I want to install Linux on my machine, so please tell me one thing which is the best to install- 1.)Red Hat 2.)Cent OS 3.)Red Hat 4.)Ubuntu 5.)Fedora except that if there is any please tell me. (1 Reply)
Discussion started by: parthmittal2007
1 Replies

3. Homework & Coursework Questions

Operating system LINUX

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be produced.... (0 Replies)
Discussion started by: paradise
0 Replies

4. Homework & Coursework Questions

Operating system LINUX

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be produced.... (1 Reply)
Discussion started by: paradise
1 Replies

5. Shell Programming and Scripting

Operating system LINUX

Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be produced. Each product will be produced in different production line. Ready products will be placed in a buffer area located at the end of each production line. Packaging workers will pack the... (1 Reply)
Discussion started by: paradise
1 Replies

6. Filesystems, Disks and Memory

Fabric Operating System

Would any of your gentlemen have come across a decent reference for the FOS in your wanderings? Brocade just seems to want to sell me classes and FAN books :/ (0 Replies)
Discussion started by: Eronysis
0 Replies

7. UNIX for Dummies Questions & Answers

Unix Operating System?

Hey all, I currently use FreeBSD and linux and have decided I want to use a proper Unix distrobution. Which Unix distro would you members recommend. The only requirments that I have is that I can use some pogramming utilities available. I don't mind the install process. One more thing, I know some... (2 Replies)
Discussion started by: -zorin
2 Replies

8. UNIX for Dummies Questions & Answers

Operating System

Which is much more powerful as an operating system: 1. Windows 2000 2. Windows 98 3. Windows XP 4. Windows ME 5. Unix 6. Linux and why is it much more powerful than the other operating systems that i have mentioned. thanks for your info... (1 Reply)
Discussion started by: alecks1975
1 Replies

9. Filesystems, Disks and Memory

cannot load any operating system

I've tried installing Linux (SuSE because it's the easiest disc I had on hand) and Windows, and neither can boot. The specific problems are below. With Linux: During the installation, I get error message on most of the packages, even though I left all of them up to the default, and it sais... (3 Replies)
Discussion started by: Derrek
3 Replies
Login or Register to Ask a Question