linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Set the prompt.
@ 2004-11-03 18:53 Edward Parrilla
       [not found] ` <e29bf9c50411031057125227a@mail.gmail.com>
  2004-11-03 19:04 ` Scott Taylor
  0 siblings, 2 replies; 7+ messages in thread
From: Edward Parrilla @ 2004-11-03 18:53 UTC (permalink / raw)
  To: Linux_admin

Hi all,
I have created this line in my .bash_profile

PS1="{${HOSTNAME}"':${PWD}}'
export PS1

However when I initiate my term session it does not show the host name,
nor the PWD.
What could be wrong?
Regards
Ed


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
       [not found] ` <e29bf9c50411031057125227a@mail.gmail.com>
@ 2004-11-03 19:00   ` Helge Pettersen
  0 siblings, 0 replies; 7+ messages in thread
From: Helge Pettersen @ 2004-11-03 19:00 UTC (permalink / raw)
  To: linux-admin

Try
PS1="\h \w"
export PS1
That will do the trick, but it looks like something not so nice.
PS1="\h \w $ "
is a bit better. :)




On 03 Nov 2004 12:53:13 -0600, Edward Parrilla <eparrilla@comcast.net> wrote:
> Hi all,
> I have created this line in my .bash_profile
>
> PS1="{${HOSTNAME}"':${PWD}}'
> export PS1
>
> However when I initiate my term session it does not show the host name,
> nor the PWD.
> What could be wrong?
> Regards
> Ed
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
  2004-11-03 18:53 Set the prompt Edward Parrilla
       [not found] ` <e29bf9c50411031057125227a@mail.gmail.com>
@ 2004-11-03 19:04 ` Scott Taylor
  2004-11-03 19:08   ` Helge Pettersen
  2004-11-03 19:12   ` Scott Taylor
  1 sibling, 2 replies; 7+ messages in thread
From: Scott Taylor @ 2004-11-03 19:04 UTC (permalink / raw)
  To: Linux_admin


Edward Parrilla said:
> Hi all,
> I have created this line in my .bash_profile
>
> PS1="{${HOSTNAME}"':${PWD}}'
> export PS1
>
> However when I initiate my term session it does not show the host name,
> nor the PWD.
> What could be wrong?

Probably.

Try:

man bash

I get:
PS1="\h:\W "
to get the output you desire.  Your way looks more like the old Korn Shell
(ksh), almost.

I like: PS1="[\u@\h \W]\\$ " (RH default, something they did right. ;)

--
Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
  2004-11-03 19:04 ` Scott Taylor
@ 2004-11-03 19:08   ` Helge Pettersen
  2004-11-03 19:12   ` Scott Taylor
  1 sibling, 0 replies; 7+ messages in thread
From: Helge Pettersen @ 2004-11-03 19:08 UTC (permalink / raw)
  To: linux-admin

No, Edward wanted `pwd` as the prompt.
\W provides only the open folder, not full path. (which \w is).


On Wed, 3 Nov 2004 11:04:19 -0800 (PST), Scott Taylor
<scott@dctchambers.com> wrote:
> 
> 
> 
> Edward Parrilla said:
> > Hi all,
> > I have created this line in my .bash_profile
> >
> > PS1="{${HOSTNAME}"':${PWD}}'
> > export PS1
> >
> > However when I initiate my term session it does not show the host name,
> > nor the PWD.
> > What could be wrong?
> 
> Probably.
> 
> Try:
> 
> man bash
> 
> I get:
> PS1="\h:\W "
> to get the output you desire.  Your way looks more like the old Korn Shell
> (ksh), almost.
> 
> I like: PS1="[\u@\h \W]\\$ " (RH default, something they did right. ;)
> 
> --
> Scott
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
  2004-11-03 19:04 ` Scott Taylor
  2004-11-03 19:08   ` Helge Pettersen
@ 2004-11-03 19:12   ` Scott Taylor
  2004-11-03 22:19     ` Edward Parrilla
  1 sibling, 1 reply; 7+ messages in thread
From: Scott Taylor @ 2004-11-03 19:12 UTC (permalink / raw)
  To: Linux_admin


Scott Taylor said:
>
> Edward Parrilla said:
>>
>> PS1="{${HOSTNAME}"':${PWD}}'
>> export PS1
>
> Try:
>
> man bash

Look for PROMPTING
/PROMTING

> I get:
> PS1="\h:\W "

Sorry, that should be lower case 'W' "\h:\w " to get a full PWD with ~/ to
represent your home directory, but it gets very long that way.

--
Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
  2004-11-03 19:12   ` Scott Taylor
@ 2004-11-03 22:19     ` Edward Parrilla
  2004-11-04  4:31       ` Glynn Clements
  0 siblings, 1 reply; 7+ messages in thread
From: Edward Parrilla @ 2004-11-03 22:19 UTC (permalink / raw)
  To: Linux_admin

Hi,
thanks for your answer. I found that what I have set works but when I
logging through X-Window session; however  it does not work if I go
through an X-term or Term session.
What is the difference.
Thanks
Edward


On Wed, 2004-11-03 at 13:12, Scott Taylor wrote:
> Scott Taylor said:
> >
> > Edward Parrilla said:
> >>
> >> PS1="{${HOSTNAME}"':${PWD}}'
> >> export PS1
> >
> > Try:
> >
> > man bash
> 
> Look for PROMPTING
> /PROMTING
> 
> > I get:
> > PS1="\h:\W "
> 
> Sorry, that should be lower case 'W' "\h:\w " to get a full PWD with ~/ to
> represent your home directory, but it gets very long that way.
> 
> --
> Scott
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Set the prompt.
  2004-11-03 22:19     ` Edward Parrilla
@ 2004-11-04  4:31       ` Glynn Clements
  0 siblings, 0 replies; 7+ messages in thread
From: Glynn Clements @ 2004-11-04  4:31 UTC (permalink / raw)
  To: Edward Parrilla; +Cc: Linux_admin


Edward Parrilla wrote:

> thanks for your answer. I found that what I have set works but when I
> logging through X-Window session; however  it does not work if I go
> through an X-term or Term session.
> What is the difference.

Some of the startup files (e.g. ~/.profile, ~/.bash_profile,
~/.bash_login, /etc/profile) are only read for "login" shells.

By default, xterm doesn't run a login shell. You can make it do so by
adding the "-ls" switch, setting the loginShell X resource, or by
explicitly specifying the -l switch to bash, e.g. "xterm -e bash -l".

Alternatively, you could put the commands into ~/.bashrc instead; that
is read for all interactive shells, not just login shells.

The main reason for the distinction is that environment variables only
need to be set once, then they will be inherited by all child
processes. If an environment variable is set based upon its previous
value (e.g. "PATH=/usr/local/bin:$PATH ; export PATH"), and you were
to do this in ~/.bashrc, the change would be made again every time you
started a subshell.

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-04  4:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 18:53 Set the prompt Edward Parrilla
     [not found] ` <e29bf9c50411031057125227a@mail.gmail.com>
2004-11-03 19:00   ` Helge Pettersen
2004-11-03 19:04 ` Scott Taylor
2004-11-03 19:08   ` Helge Pettersen
2004-11-03 19:12   ` Scott Taylor
2004-11-03 22:19     ` Edward Parrilla
2004-11-04  4:31       ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).