Setting Up Profile.......Need Help Urgently

Hi

I am not able to setup PS1 environment variable in .profile file in my Home directory.I am using RED HAT3 Linux.this is the excercise that i have done

$echo $SHELL
/bin/ksh

$pwd
/home/khan

$ls -l .profile
-rwxrwxrwx

$more .profile
set -o vi
export PS1='khan'

$echo $PS1
$

I tried reloging in,but no use.Pls. advise urgently.

Thanks
Khan.A.W

printf "%s\n" "set -o vi" "export PS1='khan'">>.bash_profile

Sir, I am using Korn Shell.Why will i go for .bash_profile then??
However i have added your line of code,but still the same result.Pls. advise urgently.

Sorry,
you said "RED HAT3" so I assumed bash as default on RedHat.
Is the korn shell your login shell?
If not you have to use .kshrc for such settings.

Still not working.Still my prompt is shown as $.
The excercise done

$more .profile
set -o vi
ENV=".kshrc"

$more .kshrc
export PS1='khan'

When i tried,

$echo $ENV

$

Why is the o/p coming blank.Strange Behaviour.Pls. advise

Thanks Khan

Could you post the output from the following commands:

ps -p $$
echo $-

What happens when you type ksh in your current session?

Here is the o/p that is coming up

$ps -p $$
pid tty time cmd
2445 pts/0 00:00:00 ksh

$echo $-
ims

$ksh
$

Pls. advise.Can you give your yahoo id.so that we can chat on Yahoo messenger.

Thanks
Khan

OK,
run echo $KSH_VERSION and ksh -l.

Given your $- output the ksh is not your login shell
so .profile is not processed.

In case of pdksh you have to set ENV before starting the shell
or start it with - or -l option to process the .profile:

- ksh

or

ksh -l

How to setup ENV here,You told me we have to set ENV before starting the shell.So what is the file that is invoked before my .Profile file.Suggest me with an example and let me know where should i place my ENV variable(in which file/Dir)

Thanks for all your Help.

Bye
Khan

I assume pdksh (given your last question):

put this entry in the profile of your _login_ shell (check /etc/passwd):

ENV="/your/file/.env"; export ENV

Then when you type ksh you'll get the file parsed.

There is something that I don't understand: you said
that $SHELL returns /bin/ksh, strange,
if /bin/ksh is your login shell, then the .profile should be parsed ...
Anyway, in your earlier posting you said:

$more .profile
set -o vi
ENV=".kshrc"

Change it to:

ENV="$HOME/.kshrc"; export ENV

No it doesn't work.The excercise done

$more .profile
set -o vi
ENV="$HOME/.kshrc"

$more .kshrc
export PS1='khan'
export NODE=$(uname -n)
export TEST='SQL >'

$echo $TEST
SQL >

$echo $NODE
localhost.localdomain

$echo $PS1
$

if i try using this command as you told earlier,i am getting the expected prompt.but i want this prompt as soon as i login to the system.

$ksh -l
khan

$

Pls. help me out.

Thanks Khan

Is anyone there........??? To Help me Out.

Post the output from the following commands:

echo $KSH_VERSION
fgrep "$USER" /etc/passwd
cat /etc/profile
cat "$HOME"/.profile
set

And also:

ls -la "$HOME"