- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problem with set_display script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2004 03:02 AM
01-23-2004 03:02 AM
Problem with set_display script
set_display.ksh
#!/sbin/ksh
#* set_display.ksh
# %W% %G% retrieved at %H% %T%
# *************************************************************************
# * Program Name: set_display *
# * Date Written: June 30, 1998 *
# * Written By : Robert Binkley*
# *************************************************************************
# * This script will set the display environment variable for this user *
# * by determining the terminal type, etc. *
# * NOTE!!! You must run this command with the ". command" structure or *
# * the environment setting will not be defined for your session when this*
# * script terminates. *
# *************************************************************************
# * Revision History: *
# * *
# * 09/17/98 R.B. Added comment line to incorporate SCCS source control. *
# * Added some general aliases at the bottom. *
# * *
# * 04/30/00 R.B. Changed argument in finger command to get system name *
# * due to move from Dec UNIX to Sun UNIX. *
# * *
# * 06/22/01 Robert Binkley Modified to work with AIX *
# *************************************************************************
echo
# Determine the process user id from the system. This will get the
# parent user even if su has been used.
USER_NAME=`who am i | awk '{ print $1 }'`
echo "Setting USER_NAME to" $USER_NAME
export USER_NAME
# Determine the terminal id for the parent user's process.
TTY_NAME=`who am i | awk '{ print $2 }'`
echo "Setting TTY_NAME to" $TTY_NAME
export TTY_NAME
# Determine the host machine for this user and terminal id. This is used
# to assign the DISPLAY variable for X-based application stuff.
HOST_MACHINE=`who am i | awk -F'[\t()]' '{ print $2 }'`
case "$HOST_MACHINE" in
[a-zA-Z]* )
HOST_MACHINE=`who am i | awk -F'[\t()\.]' '{ print $2":0.0" }'`
;;
[0-9]* )
HOST_MACHINE="$HOST_MACHINE:0.0"
;;
esac
echo "Setting DISPLAY to $HOST_MACHINE"
#export DISPLAY=$HOST_MACHINE
# Add this alias function for some general "coolness".
alias ll='ls -l'
alias lst='ls -ltr'
echo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2004 03:09 AM
01-23-2004 03:09 AM
Re: Problem with set_display script
However, what you could do is source this script using the . (dot) operator to incude this script as part of the foreground process. In this case, make sure that the sourced file has no exit or return statements because you will instantly exit the foreground process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2004 03:09 AM
01-23-2004 03:09 AM
Re: Problem with set_display script
DISPLAY=$(who -m -u | awk '{print $8}'):0.0
export DISPLAY
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2004 03:47 AM
01-23-2004 03:47 AM
Re: Problem with set_display script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2004 04:05 AM
01-23-2004 04:05 AM
Re: Problem with set_display script
. myScript
The dot command tells the current shell to read and interpret the commands locally rather than n a sub-shell.
Bill Hassell, sysadmin