mcgoosh
mcgoosh

Reputation: 59

Irix bash strangeness

So in my .bash_profile I'm using the following to show my user@hostname + the pwd in my Winterms/XWsh terminal title.

export PROMPT_COMMAND='echo -ne "\033P1.y$USER@$HOSTNAME: $PWD \033\\"'

This works fine in Irix but if I attempt to ssh into my Irix box I'm greeted with the following:

1.ys0ke@bosco: /usr/people/s0ke s0ke@bosco ~$

Which I understand that it's running the PROMPT_COMMAND so that is executed before the printing of each primary prompt. But my question is there any way to get rid of this when attempting to to connect from another box? Essentially I would just like the user@hostname displayed instead of the entire user@host + pwd when I am using ssh.

Upvotes: -1

Views: 106

Answers (2)

KamilCuk
KamilCuk

Reputation: 141155

But my question is there any way to get rid of this when attempting to to connect from another box?

So do not export the PROMPT_COMMAND, so that child processes will not inherit it. Remove the export.

Upvotes: 1

user1934428
user1934428

Reputation: 22237

bash has the ability to desplay user and hostname already built into its prompting system. See the bash man-page, section "PROMPTING":

          \h     the hostname up to the first `.'
          \H     the hostname
          \u     the username of the current user

Upvotes: 0

Related Questions