Changing the prompt only in .profile only will set it based on how you enter 
OMVS
or the shell.  To change it back and forth as you enter and exit "su" requires 
the
ENV variable be set and putting the code there instead:

Here is how I used to do it via /etc/profile:

UID=`id -u `                                           
if [ "$UID" = "0" ]                                    
then                                                   
  export PS1=`uname -n `:'$LOGNAME':'$PWD':' # '       
else                                                   
  export PS1=`uname -n `:'$LOGNAME':'$PWD':' $ '       
fi              

This is what I have been doing for a number of years instead: 
 
in /etc/profile I have this:

# set up "global" ENV script
export ENV=/etc/@ENV         

And instead of the code above that checks the UID being in /etc/profile, it is 
in /etc/@ENV

For myself, I prefer a little more of a "visual" when I'm running as superuser 
just
in case I don't realize it from the '#' prompt (for example, if you set SU in 
ISHELL then
do TSO OMVS, you start as superuser.  In my $HOME/.profile I set  ENV like this:

export ENV=$HOME/@myenv    

"@myenv" contains this (note the extra [su] is part of the prompt) :

#===================================                 
# Set prompt                                         
#===================================                 
UID=`id -u `                                         
if [ "$UID" = "0" ]                                  
then                                                 
  export PS1=`uname -n `:'$LOGNAME':'$PWD':'[su]# '  
else                                                 
  export PS1=`uname -n `:'$LOGNAME':'$PWD':'$ '      
fi                                                   

I have some other things in @myenv also -  vi settings, aliases. The only 
problem is
I have gotten used to some of these aliases of the years and of course they 
don't
exist on systems I seldom work on.    Here is the entire "@myenv" from one of 
my LPARs:


#===================================                    
# Set prompt                                            
#===================================                    
UID=`id -u `                                            
if [ "$UID" = "0" ]                                     
then                                                    
  export PS1=`uname -n `:'$LOGNAME':'$PWD':'[su]# '     
else                                                    
  export PS1=`uname -n `:'$LOGNAME':'$PWD':'$ '         
fi                                                      
#===================================                    
# vi setting for recall                                 
#===================================                    
set -o emacs                                            
#===================================                    
# set up my aliases for DOS commands                    
#===================================                    
alias dir="ls -al"                                      
alias del="rm"                                          
alias delete="rm"                                       
alias erase="rm"                                        
alias help="man"                                        
alias rename="mv"                                       
alias move="mv"                                         
alias copy="cp -Rp"                                     
alias md="mkdir -p"                                     
alias rd="rmdir"                                        
alias ver="uname -a"                                    
alias cd..="cd .."                                      
alias clear="tput clear"                                
alias cls="tput clear"                                  
#===================================                    
# other aliases                                         
#===================================                    
alias rehash="hash -r"                                  
alias ll="ls -l"                                        
alias la="ls -a"                                        
alias lal="ls -al"                                      
alias l="ls -alF"                                       
alias h="fc -l"                                         
alias m="more"                            


Regards,

Mark
--
Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS
ITIL v3 Foundation Certified
mailto:[email protected]
Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html
Systems Programming expert at http://search390.techtarget.com/ateExperts/       
       
                            



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to