Sponsored Content
Full Discussion: which machine
Top Forums UNIX for Advanced & Expert Users which machine Post 83185 by vino on Monday 12th of September 2005 11:01:03 AM
Old 09-12-2005
I think it might be posted in your

Code:
/proc/cpuinfo

if it is a linux machine. /proc based systems are present on Linux. Havnt seen them on Solaris. Not sure about other distro's.

Here is a script I had to check out the Linux distro. (It might be useful.)

Code:
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.

OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`

GetVersionFromFile()
{
        VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
}

if [ "${OS}" = "SunOS" ] ; then
        OS=Solaris
        ARCH=`uname -p`
        OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
elif [ "${OS}" = "AIX" ] ; then
        OSSTR="${OS} `oslevel` (`oslevel -r`)"
elif [ "${OS}" = "Linux" ] ; then
        KERNEL=`uname -r`
        if [ -f /etc/redhat-release ] ; then
                DIST='RedHat'
                PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
                REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
        elif [ -f /etc/SuSE-release ] ; then
                DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
                REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
        elif [ -f /etc/mandrake-release ] ; then
                DIST='Mandrake'
                PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
                REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
        elif [ -f /etc/debian_version ] ; then
                DIST="Debian `cat /etc/debian_version`"
                REV=""

        fi
        if [ -f /etc/UnitedLinux-release ] ; then
                DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
        fi

        OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"

fi

echo ${OSSTR}

Vino
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Link type between working machine and server machine

There are two servers where my machine is connected. Is there any type of link formed between my machine and server machine? (1 Reply)
Discussion started by: palash2k
1 Replies

2. Solaris

Best possible communication mechanism between a Solaris machine and a windows machine

hi, I have some windows client machines which require a signal to be sent by a Solaris machine( SunOS 5.6) when ever a particular event occurs on that Solaris machine. What are possible communication mechanisms by which i can do this. the constraints are > the windows machines have to... (7 Replies)
Discussion started by: Krsh
7 Replies

3. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

4. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

5. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

6. Shell Programming and Scripting

Script to run Klocwork from Machine 1 to machine 2

I use Ubuntu 10.04 in 2 virtual machines. In one machine I have installed Hudson and another machine is to run klocwork. Scenario is when I trigger a build in Hudson, the script has to run successful and call the Klocwork in VM2. In the build script I have given the following command to call... (1 Reply)
Discussion started by: bsreeram
1 Replies

7. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

8. Linux

Unable to connect to Server machine from a client machine using ftp service

Hi, Could you please help me with the below issue.. I'm running RHEL6 OS on both server (192.168.0.10) and client machines (192.168.0.1). I'm trying to connect to server from the client machine using ftp service. I have installed vsftpd daemon on both the machines. I'm getting... (4 Replies)
Discussion started by: raosr020
4 Replies

9. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

10. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies
fixnt(1)							      Debian								  fixnt(1)

NAME
fixnt - Filter for the Windows NT postscript printer driver. SYNOPSIS
fixnt < BADFILE.ps > GOODFILE.ps DESCRIPTION
The Windows NT postscript driver has a tendency to make broken postscript files, that are incompatible with psutils. fixnt is a filter that fixes these problems, allowing the use of psnup(1). The filter takes the broken postscript file on stdin, and outputs a fixed postscript file on stdout. It has no other form for invocation and takes no options on the command-line. OPTIONS
fixnt takes no options. BUGS
fixnt does not check for NTPSOct94. For a workaround, use a sed(1) command to replace 'NTPSOct94' with 'NTPSOct95', like so: sed 's/NTPSOct94/NTPSOct95/g' This is particularly important for Windows NT 3.5 users. AUTHOR
fixnt was written by Holger Bauer <Holger.Bauer@topmail.de>, Michael Rath <rath@itsm.uni-stuttgart.de>, and Akim Demaille <demaille@inf.enst.fr>. REPORTING BUGS
Report bugs to the Authors, but avoid sending large postscript files. Patches are always welcome; send to <bauer@itsm.uni-stuttgart.de>. SEE ALSO
psnup(1), sed(1) a2ps February 2003 fixnt(1)
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy