Previous Section  < Day Day Up >  Next Section

LAB 16: THE case STATEMENT

  1. The ps command is different on BSD and AT&T UNIX. On AT&T UNIX, the command to list all processes is:

    
    ps –ef
    
    

    On BSD UNIX and Linux, the command is

    
    ps –aux
    
    

    Write a program called systype that will check for a number of different system types. The cases to test for will be

    AIX

    Darwin (Mac OS X)

    Free BSD

    HP-UX

    IRIX

    Linux

    OS

    OSF1

    SCO

    SunOS (Solaris / SunOS)

    ULTRIX

    Solaris, HP-UX (10.x+), SCO, and IRIX are AT&T-type systems. The rest are BSD-ish.

    The version of UNIX/Linux you are using will be printed to stdout. The system name can be found with the uname –s command or from the /etc/motd file.

    Previous Section  < Day Day Up >  Next Section