System Administration Guide, Volume 2

How to Convert Printer Configuration Information in NIS+ (+xfn) to NIS+ Format

The following conversion script can only be run on a system running the Solaris 8 release.

  1. Log in as superuser on the NIS+ master.

  2. Copy the following conversion script to system and name it something like /tmp/convert.


    #!/bin/sh
    #
    #	Copyright (C) 1999 by Sun Microsystems, Inc.
    #	All Rights Reserved
    #
    PRINTER=""
    
    for LINE in `lpget -n xfn list | tr "\t " "^A^B"` ; do
    	LINE=`echo ${LINE} | tr "^A^B" "\t " | sed -e 's/^	 \t//g'`
    	case "${LINE}" in
    		*:)
    			PRINTER=`echo ${LINE} | sed -e 's/://g'`
    			;;
    		*=*)
    			lpset -n nisplus -a "${LINE}" ${PRINTER}
    			;;
    	esac
    done

    Note -

    If you cut and paste this script into a text file, change both ^A^B (caratA caratB) sequences to Control A Control B.


  3. Make the script executable.


    # chmod 755 /tmp/convert
    
  4. Run the conversion script.


    # /tmp/convert