whoami & pwd in comandline?

whoami & pwd in comandline?

Post by ben~ » Wed, 30 May 2001 06:00:09



i've been able to add "pwd" to the Bash commandline (PS1='$PWD>'), but
not "whoami" (tried PS1='$whoami $PWD>'). is this posible??
also why is .profile not run when i "su" to root? what file will in need
to edit so that i can get "whami" AND "PWD" in the command line for
root. did i miss something in "man bash"? or is there another place that
i can find all the bash command line modifieres?
thanks.
ben~
 
 
 

whoami & pwd in comandline?

Post by bpalme » Wed, 30 May 2001 06:09:30



> i've been able to add "pwd" to the Bash commandline (PS1='$PWD>'), but
> not "whoami" (tried PS1='$whoami $PWD>'). is this posible??
> also why is .profile not run when i "su" to root? what file will in need
> to edit so that i can get "whami" AND "PWD" in the command line for
> root. did i miss something in "man bash"? or is there another place that
> i can find all the bash command line modifieres?
> thanks.

If you are using bash,  try something like:


This will give you:


:)

- Brandon

--


pgp:  www.crimelabs.net/bpalmer.pgp5

 
 
 

whoami & pwd in comandline?

Post by Sami J. Juvon » Wed, 30 May 2001 07:01:23



>   i've been able to add "pwd" to the Bash commandline (PS1='$PWD>'), but
>   root. did i miss something in "man bash"? or is there another place that
>   i can find all the bash command line modifieres?

What's wrong with 'man bash'? Look for PROMPTING.

-s.

 
 
 

whoami & pwd in comandline?

Post by Peter Booste » Wed, 30 May 2001 15:53:54



[snip]

Quote:> also why is .profile not run when i "su" to root?

su -
(mind the dash)

Peter

 
 
 

1. pwd as prompt (was: pwd as prompt )

Oops. Sorry for posting the reply twice - finger trouble meant that
half the first message got lost.

Either that or the caffeine to blood ratio got too low :-}

Regards

--
------------------------------------------------------------------------------
Bruce Horrocks                       Windows NT -
Surrey, England                      "WOMAN PREGNANT FOR 65 YEARS GIVES

------------------------------------------------------------------------------

2. QNX vs Linux

3. pwd not in csh/tcsh, coding /bin/pwd ?

4. Load failure for xemacs on Linux

5. &&&&----Looking for a unix shell------&&&&&

6. HELP!

7. ppp && PPPoE && ADSL && net && buffer(s)

8. AcceleratedX

9. 没有人用中文吗?

10. Ls & pwd just died!

11. Strange Severe Issue: chpass -s with non-existent shell wipes root pwd &....

12. Sending Login &PWD to Sybase

13. ksh & perl approach to pruning long pwd prompts