- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- user profiles and shell environments
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
Discussions
Discussions
Forums
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
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-16-2004 07:04 AM
тАО01-16-2004 07:04 AM
As a small example of what I'd like to see, the HP manual "Shells: User's Guide", Chapter 23, gives the following interesting code:
EXPORT ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'
export FILE=$HOME/.envfile
which cuases the $HOME/.kshrc to be executed, unless you are in an interactive shell.
If you have other examples that you've found useful for your environment, even if it's just setting up your TERM variable, please share them here. Thanks,
Mladen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:10 AM
тАО01-16-2004 07:10 AM
SolutionHow about checking for mail:
# Notify if there is mail
if [ -f /usr/bin/mail ]
then
if mail -e
then echo "You have mail."
fi
fi
or for a really nice prompt with system name, working directory and who you are logged on as:
export SYSNAME=`uname -n`
export PS1='${SYSNAME}:[ ${PWD} ]
${LOGNAME}> '
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:17 AM
тАО01-16-2004 07:17 AM
Re: user profiles and shell environments
# sets .sh_hist file to id of user
if [ "`tty`" = "/dev/console" ]
then
REAL=console
else
REAL=`logname`
fi
HISTFILE=$HOME/.sh_$REAL
export HISTFILE
HISTSIZE=1000; export HISTSIZE
I also have a few aliases...
# list of my aliases
alias dir='ls -la'
alias lt='ls -lt'
alias lrt='ls -lrt'
alias pp='ps -aef|grep'
alias lsfg='lsf |grep '\/''
alias tops='top -h -s 1'
alias ls='ls -l'
alias bpps='/opt/openv/netbackup/bin/bpps -a'
##My users' prompt is as follows:
export PS1="`hostname`:/\${PWD#*}> "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:33 AM
тАО01-16-2004 07:33 AM
Re: user profiles and shell environments
How abount a little ascii ART before you startup:
http://www.chris.com/ascii/
http://www.ascii-art.de/
http://www.arkworld.com/ascii/
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:33 AM
тАО01-16-2004 07:33 AM
Re: user profiles and shell environments
How about a little ascii ART before you startup:
http://www.chris.com/ascii/
http://www.ascii-art.de/
http://www.arkworld.com/ascii/
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:35 AM
тАО01-16-2004 07:35 AM
Re: user profiles and shell environments
One of the things I did is to manipulate /etc/profile (and /etc/csh.login) not to allow certain users to login to the box. Write a bit of code that reads a file and compares it again $LOGNAME and exits if it matches.
Other thing is to set a "readonly" TMOUT value like export TMOUT=20;readonly TMOUT
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 07:55 AM
тАО01-16-2004 07:55 AM
Re: user profiles and shell environments
if [ "$TMOUT" != 7200 ]
then
if [ $LOGNAME = "
then
TMOUT=999999; export TMOUT; readonly TMOUT
else
TMOUT=7200; readonly TMOUT; export TMOUT
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 08:01 AM
тАО01-16-2004 08:01 AM
Re: user profiles and shell environments
# Setup logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1 }'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=500
export HISTSIZE
echo "WARNING: YOU ARE SUPERUSER !!\n"
HOST=`uname -n`
PS1="\$HOST:\$LOGNAME:\$PWD # ";export PS1
stty erase ^H
set -o vi
So, when I su to root, all my commands go into:
.sh_history_gwild
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 09:50 AM
тАО01-16-2004 09:50 AM
Re: user profiles and shell environments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2004 09:52 AM
тАО01-16-2004 09:52 AM