1832831 Members
3171 Online
110047 Solutions
New Discussion

Re: prompt

 
Satish Y
Trusted Contributor

prompt

Hi experts,

Facing a strange problem in our HP-UX systems... the users for whom PS1 is not set in their own profiles, getting "blabla@blabla==>" prompt, which is prompt of a user in our team... though nothing set for PS1 in /etc/profile.
Any idea why it is happening?...

same problem we found in SUN SOLARIS systems also...

Thanks in advance...
Cheers..
Satish.
Difference between good and the best is only a little effort
16 REPLIES 16
Hai Nguyen_1
Honored Contributor

Re: prompt

Satish,

Check to see whether users' profile "sources" any env files which may have set PS1.

Hai
Jeff Schussele
Honored Contributor

Re: prompt

Hi Satish,

Several things:

1) Check that /etc/profile is not sourcing the user's profile that appears as PS1.

2) Verify that the user's shell is what you expect - you may be looking in the wrong ".profile"

3) Verify that the affected user's profiles are not sourcing the user's profile that appears as PS1

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: prompt

Hi:

If the PS1 prompt isn't set in /etc/profile nor in the user's profile, and this is occuring on your Solaris systems, too, I'd look for a common application that is run or a file that is sourced. Something appears to be setting and exporting the PS1 variable.

Regards!

...JRF...
Shannon Petry
Honored Contributor

Re: prompt

Did you look at their $HOME/.profile, $HOME/.cshrc, and or $HOME/.login? The default .login file fer HP-UX sets the prompt in a similar showing as you mention, but looks like the one user has adapted a bit.

Regards,
Shannon
Microsoft. When do you want a virus today?
Sandip Ghosh
Honored Contributor

Re: prompt

Look at your /etc/passwd file. May be the User ID for both the user is having the same.

Sandip
Good Luck!!!
Satish Y
Trusted Contributor

Re: prompt

None of the trials hit the target... :)

Cheers...
Satish.
Difference between good and the best is only a little effort
Dave La Mar
Honored Contributor

Re: prompt

Satish -
We set this in the .kshrc file.
Verify the shell being used and try looking there.
i.e. .shrc and others.
Good Luck.
dl
"I'm not dumb. I just have a command of thoroughly useless information."
Jeff Schussele
Honored Contributor

Re: prompt

Hi Satish,

Do the users get the prompt the instant they login?
Or does it show up later - like after they've run something.

If it's right away, I'd look at everything in /etc/profile & the user's profiles to see if a script may be exporting a PS1 value.

If it's after something's been run, I'd certainly check it & anything that it calls.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Hai Nguyen_1
Honored Contributor

Re: prompt

Satish,

I assume that the user's default shell is sh. Can you turn on the shell's debug mode by adding "set -x" as the first line in .profile to see if the output gives you more clues?

Hai
Satish Y
Trusted Contributor

Re: prompt

No luck...
Difference between good and the best is only a little effort
Hai Nguyen_1
Honored Contributor

Re: prompt

Ok. Let me try to isolate the problem another way.

Can you perform the following steps:

# mv /home/user /home/user.sav
# mkdir /home/user
# chmod xxx /home/user # same as original
# chown user:group /home/user # same as original

And then try to login as the user to the system. If the prompt is gone then some profile in /home/user.sav had set it. Otherwise, the system default profile sets it.

Hai
Dave La Mar
Honored Contributor

Re: prompt

Satish -
Hai has a good point. Look in /etc/profile which is accessed on login before their /home/.profile
or /home/.kshrc (etc).

Hang in There. We'll keep looking.

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Martin Johnson
Honored Contributor

Re: prompt

Why don't you put some debugging statements into /etc/profile and $HOME/.profile, such as "echo PS1=$PS1". Putting them in the front and back of the script will tell you whether the variable was changed by something in the script. Additional debugging statement could help you determine where in the script the variable is being changed.

HTH
Marty
Satish Y
Trusted Contributor

Re: prompt

Hai, ur solution is good but i have more than 200 users, i can't do the same for all users.. thats the big prob....
Satish.
Difference between good and the best is only a little effort
Hai Nguyen_1
Honored Contributor

Re: prompt

Satish,

C'mon, you can try my idea on one user just to narrow down the root cause.

By the way, does the following command

# echo $ENV

returns a value? If yes then this $ENV file is sourced after profile.

Hai
Wodisch_1
Honored Contributor

Re: prompt

Hi Satish,

how do your users log in?
- telnet,ssh or rlogin? Then show this /etc/profile of yours so we can find the line containg the "." (source) command
- X-Windows? Then you start to look in "/etc/dt/config/Xconfig" and work down from there...

Just my $0.02,
Wodisch