|
|
Not needed if you are already defining PS1 (+ example)
To clarify: If you are already defining a custom PS1 entry in such an rc file, it will be picked up by "sudo -s", as well - so this specific "SUDO_PS1" entry would not be needed.
FYI, I use a custom entry within my .profile to display the path within brackets - truncating to just the final directory, if the path grows too long (see "MAXPWDLEN"):
This results in, for example:
[mymac:/Users/classic] classic$
as well as responding to input as: (remember, ellipses are entered via "Option-semicolon"; if these don't work for you, just substitute 3 periods, or the like)
Not needed if you are already defining PS1 (+ example)
I use the following prompt in .profile and using sudo -s does not keep it:
Not needed if you are already defining PS1 (+ example)
Ah, but .profile is only run for direct login shells - of which performing a sudo -s doesn't qualify, as it is merely starts a sub-shell within that same session.
If you put that same command in your .bashrc file instead, you should be better off. Also, note that several folks simply source the one file from the other - I have a grand total of one line in my .profile: source $HOME/.bashrc to handle just such a provision, and ensure the same environment is established upon first login, as well as when starting sub-shells.
Not needed if you are already defining PS1 (+ example)
Yoy are missing a backslash in the first printf line. It should read:
printf "%s" "
${MYPWD/${MYPWD%*\/*}/}" || \
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|