Editing the /etc/profile.d/ipm_environment.sh file

To set an environment variable in the /etc/profile.d/ipm_environment.sh file, you need to edit the file with a Linux editor. See How are environment variables set? and What restrictions apply? for additional information.

This example shows how to set the PDPRINTER environment variable in the /etc/profile.d/ipm_environment.sh file using a Linux editor:

  1. Enter this command to change to the /etc/profile.d/ directory:
    cd /etc/profile.d/
  2. Enter this command:
    vi ipm_environment.sh

    A typical /etc/profile.d/ipm_environment.sh file contains lines similar to this:

     # /etc/profile.d/ipm_environment
    
    #only set PATH if it does not exist(add pd)
    if ! echo ${PATH} | /bin/grep -q /usr/lpp/pd/bin ; then
       export PATH=/usr/lpp/pd/bin:${PATH}
    fi
    
    #only set PATH if it does not exist(add psf)
    if ! echo ${PATH} | /bin/grep -q /usr/lpp/psf/bin ; then
       export PATH=/usr/lpp/psf/bin:${PATH}
    fi
    
    
    if ! echo ${PDBASE} | /bin/grep -q /var/pd ; then
       export PDBASE=/var/pd
    fi
    
    if ! echo ${NLSPATH} | /bin/grep -q /usr/lib/locale/%L/LC_MESSAGES/%N ; then
       export NLSPATH=/usr/lib/locale/%L/LC_MESSAGES/%N:$NLSPATH
    fi

  3. Insert or modify this line in the /etc/profile.d/ipm_environment.sh file:
    export PDPRINTER=LogicalDestinationName
    where LogicalDestinationName is the name of the logical printer you want to set as the default logical printer for all users.
  4. Save the change in plain text format and exit from the editor.
  5. Make the change effective by entering the command:
    . ./ipm_environment.sh
  6. Verify the change by entering the command:
    echo $PDPRINTER
    The logical destination name you entered displays.