Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIC prompts

Status
Not open for further replies.

generaal

Programmer
Jan 11, 2007
58
ZA
There was a new server installed recently. On the terminal window, i start with the default # prompt, which i really want to change. In the .profile, there is an entry for a prompt:

PS1="$USER-`uname -n`:\$PWD#"
export PS1

Why can i not see that prompt when i open a terminal window?

Also, commands like ESC+K, etc do not work. I tried to do the following, but that did not work either:

TERM = vt100
export TERM

 
Hello there,
Try this

PS1=$LOGNAME-`uname -n`':$PWD# '
stty erase ^H
stty erase ^?
export PS1
set -o vi

Once you enter this (in .profile) save and exit. Make sure you are using the correct '.profile' file, before you edit the file verify that you are in the home directory of root (use cd ~) to jump to home directory.

Let me know how it goes, also you have to logout and logback in once you make those changes.
 
Hi. Thanks for the assist, but there is still no change. This is the current contents of the .profile file, with all comments edited out:

set -o vi

if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.

PS1=$LOGNAME-`uname -n`':$PWD# '
stty erase ^H
stty erase ^?
export PS1
set -o vi
 
Hmmm,
Its strange why its not working for you, I used your output and used for one of my server, I can use (esc+k and delete using back space and the prompt is ($logname-uname -n). I used ssh and also I used console for login, both works file.

What file are you editing?
There are two files for profile
1. .profile (In home directory of any user)
2. /etc/profile (It is the global profile for all other users, you can modify this as root only)

If you are root and trying to edit ONLY root's profile, go to its home directory and edit it.
 
On this server, the / directory is root's home directory. The profile i edited is in that directory.

# cd ~
# pwd
/
#
 
What os version you are using? What shell you are using?

Add the below line on the top of .profile file
#!/usr/bin/ksh

 
On this server we are running AIX 6
I added the line but doesn't the # sign in front mean that it is commented out?[highlight #FCE94F][/highlight]
 
You should chech your shell settings in the file /etc/security/passwd, or rather in SMIT. The shell should be set there.


The # sign on the beginning of the first line of a script is not a comment It should be followed by an exclamation mark an the name of the binary to pass the file to be executed.

If you have a file (say example.sh) with exec flag set and whith the content
[tt]
#!/usr/bin/ksh

echo this is a KSH script
[/tt]

When you type ./example.sh at the prompt, then the file will be passed to the program /usr/bin/ksh. This mechanism can be used to run scripts with any binaries.

--Trifo
 
Hmmm,

Who is the owner of the file? what permission are set on the file

Send me the output of below commands ( as root)
1. cd ~
2. pwd
3. ls -l .profile
4. cat .profile
5. cat /etc/profile (just paste the lines of PS1= .... to export PS1)


 
# cd ~
# pwd
/
# ls -l.profile
ls: Not a recognized flag: .


# cat .profile
set -o vi
#!/usr/bin/ksh
#VISUAL=/usr/bin/vi
#EDITOR=/bin/vi

#K_PATH=/vwsa
#K_DATA=/vwsadat

#export K_PATH K_DATA

#PATH=$PATH:/vw:/vw/bin:/usr/local/vwbin:/usr/local/lib:/usr/local/bin:/vw/plossys/vw/simple_plot:$K_PATH/catia/bin

#export VISUAL PATH EDITOR

if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.

PS1=$LOGNAME-`uname -n`':$PWD# '
stty erase ^H
stty erase ^?
export PS1
set -o vi

#function go {
# cd $1
#alias l="ls -lt"
#alias logs="cd /vw/addback/logs"
#cd
#The following line is added by License Use Management installation
#export PATH=$PATH:/var/ifor:/usr/opt/ifor/ls/conf:/vw/plossys/vw/simple_plot
#The following line is added by License Use Management installation
#export PATH=$PATH:/usr/opt/ifor/ls/os/aix/bin

#cat /etc/profile
PS1="`uname -n`:`pwd`# "
export PS1

export PS1="$USER-`uname -n`:\$PWD#"
 
I think it's fixed now. In .dtprofile, the line DTSOURCEPROFILE=true was commented out. I uncommented the line, logged out and logged in again and now it is working. Thank you for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top