Unix Shell - How do I change the prompt in SunSolaris (should display pwd) ?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2005 > How do I change the prompt in SunSolaris (should display pwd) ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How do I change the prompt in SunSolaris (should display pwd) ?
Eugen Meister

2005-02-08, 8:48 pm

I entered

PS1='$PWD>'
in .profile but this didn't help.
Is there a special setting for SunSolaris?

Eugen

Chris F.A. Johnson

2005-02-08, 8:48 pm

On Tue, 08 Feb 2005 at 20:46 GMT, Eugen Meister wrote:
> I entered
>
> PS1='$PWD>'
> in .profile but this didn't help.
> Is there a special setting for SunSolaris?


Which shell are you using? The man page for that shell should tell
you what you need to know.

--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Dave Uhring

2005-02-08, 8:48 pm

On Tue, 08 Feb 2005 21:46:52 +0100, Eugen Meister wrote:

> I entered
>
> PS1='$PWD>'
> in .profile but this didn't help.
> Is there a special setting for SunSolaris?


Depends completely on your shell. If it is /usr/bin/bash:

$ PS1='\w>'

mjt

2005-02-08, 8:48 pm

Eugen Meister wrote:

> I entered
>
> PS1='$PWD>'
> in .profile but this didn't help.
> Is there a special setting for SunSolaris?



.... ask in a Sun Solaris Unix newsgroup

--
<< http://michaeljtobler.homelinux.com/ >>
If you're Catholic you've only got two choices: periodic
abstinence and complete continence; (you know, rhythm and blues).

Dan Espen

2005-02-08, 8:48 pm

e.meister@lycos.de (Eugen Meister) writes:

> I entered
>
> PS1='$PWD>'
> in .profile but this didn't help.
> Is there a special setting for SunSolaris?


No, there is a special setting for each shell.
Christopher W Aiken

2005-02-24, 5:58 pm

Dan Espen <daneNO@SPAM.mk.telcordia.com> wrote in
news:ic8y5yjwxm.fsf@home-1.localdomain:

> e.meister@lycos.de (Eugen Meister) writes:
>
>
> No, there is a special setting for each shell.



Have you tried the bash "built in's", especially "\W"?

When executing interactively, bash displays the primary prompt PS1
when it is ready to read a command, and the secondary prompt PS2
when it needHave you tried any of the built in features: s more
input to complete a command. Bash allows these prompt strings
to be customized by inserting a number of backslash-escaped
special characters that are decoded as follows:

\a an ASCII bell character (07)
\d the date in "Weekday Month Date" format
\D{format} the format is passed to strftime(3) and the result
is inserted into the prompt string; an empty format results
in a locale-specific time representation. The braces are
required
\e an ASCII escape character (033)
\h the hostname up to the first `.'
\H the hostname
\j the number of jobs currently managed by the shell
\l the basename of the shell's terminal device name
\n newline
\r carriage return
\s the name of the shell, the basename of $0 (the portion
following the final slash)
\t the current time in 24-hour HH:MM:SS format
\T the current time in 12-hour HH:MM:SS format
\@ the current time in 12-hour am/pm format
\A the current time in 24-hour HH:MM format
\u the username of the current user
\v the version of bash (e.g., 2.00)
\V the release of bash, version + patchelvel (e.g., 2.00.0)
\w the current working directory
\W the basename of the current working directory
\! the history number of this command
\# the command number of this command
\$ if the effective UID is 0, a #, otherwise a $
\nnn the character corresponding to the octal number nnn
\\ a backslash
\[ begin a sequence of non-printing characters, which could
be used to embed a terminal control sequence into the
prompt

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com