[Solved] Constructed a multi-purpose prompt but still have 1 issue

I didn't think re-opening my old thread was a good idea so I'm starting  new one to address 1 issue I have left to conquer.
With some help from JWR I have built my prompt and it works for users and root logged into a local machine.  Logging into a remote machine does change my user's prompt by appending :ssh: to it.  However, as the root user logged into a remote machine, which should have the  :ssh: appended to it, doesn't work.  By that I mean that root logged in to a remote system doesn't get the correct prompt.  I want the prompt to look like this for root:
:root: ~ :ssh:
Instead I get this prompt which lacks the word "root" in it:
: ~ ::ssh:
This is my prompt script so far and I'd really appreciate some help to nail down this glitch. 
The script for root and user are identical apart from having a different prompt uncommented.
### Other prompt styles to use later
This is root's current script:
### A PS1 for each computer is on the respective lines in this order:
### ### White Yunzi / Silver Yunzi / Pink Yunzi / Rainbow EeePC
if [[ -n $SSH_CLIENT ]]; then
# PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # WY SSH
PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # SY SSH
# PS1='\[\e[0;37m\]: \[\e[1;35m\]\W\[\e[0;37m\] :\[\e[0;37\m]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # PY SSH
# PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # EeePC SSH
elif [[ ${EUID} == 0 ]]; then ## :root: ~ :
# PS1='\[\e[0;37m\]:\[\e[1;32m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;92m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # WY root
PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # SY root
# PS1='\[\e[0;37m\]:\[\e[1;35m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;35m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # PY root
# PS1='\[\e[0;37m\]:\[\e[1;33m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;33m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # EeePC root
else ## : ~ :
# PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # WY user
PS1='\[\e[0;37m\]: \[\e[1;34m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # SY user
# PS1='\[\e[0;37m\]: \[\e[1;35m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37\m] ' # PY user
# PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # EeePC user
fi
## :root: ~ :ssh:
#PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[1;34m\] \W \[\e[0;37m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
## :root:: ~ :ssh:
#PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W \[\e[0;37m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
## :root:: ~ ::ssh:
# PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W\[\e[0;37m\] :\[\e[m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
Last edited by MoonSwan (2014-11-19 09:23:02)

jasonwryan wrote:So it works for root locally, just not when you SSH in as root or change to root in an SSH session?
Yes, you're quite correct.
jasonwryan wrote:Also, it might help if you remove the commented lines, it is pretty hard to work out what is going on in there...
I agree and I found a bunch of \'s that I missed.  Sorry about that!
Here's the config stripped of extraneous junk:
if [[ -n $SSH_CLIENT ]]; then
PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # WY SSH
elif [[ ${EUID} == 0 ]]; then ## :root: ~ :
PS1='\[\e[0;37m\]:\[\e[1;32m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;92m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # WY root
else
PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # WY user
fi
Edit:  stripped out two comments I'd missed earlier.
Last edited by MoonSwan (2014-11-19 08:27:27)

Similar Messages

  • I cannot install iTunes.  I get a Windows Error 126 and missing msvcr80.dll.  I've tried uninstalling and re-installing based on all the suggestions, but still have an issue

    I cannot install iTunes.  I get a Windows Error 126 and missing msvcr80.dll.  I've tried uninstalling and re-installing based on all the suggestions, but still have an issue.  I've removed all the services, tried moving the dll files as suggested, but I still have no success.  Spent all day on this issue.  I am running windows 7.

    Sorry to hear this isn't going smoothly for you. Try  Troubleshooting issues with iTunes for Windows updates. You may have seen some of the suggestions here before but is has taken some users more than one attempt.
    tt2

  • [Solved] Bash: Want to supress output but still have it recorded

    I'd like to run a test, have it known but the output not to show.  How do I do this?
    [[ -z $(ls -1 screencast-[0-9][0-9][0-9][0-9]*) ]] && echo hi
    If I send it to /dev/null it doesn't get recorded, what do I do?
    Last edited by Gen2ly (2012-08-23 14:08:00)

    Send it to a file - or a variable.
    *think I must be missing something*
    Oh, after reading better I think I get it, though the answer would be the same.  Do you only want the return code of the command used for the test while other output is ignored?  Various options depending on your need:
    commmand >/dev/null
    [[ $? -eq 0 ]] && conditionally-executed-command
    [[ `command >/dev/null` ]] && conditionally-executed-command
    command > ~/my.log
    VARIABLE_LOG=$(command)
    Last edited by Trilby (2012-08-23 12:46:26)

  • After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    Verifying volume “Macintosh HD”
    Performing live verification.
    Checking Journaled HFS Plus volume.
    Checking extents overflow file.
    Checking catalog file.
    Checking multi-linked files.
    Checking catalog hierarchy.
    Checking extended attributes file.
    Checking volume bitmap.
    Checking volume information.
    The volume Macintosh HD appears to be OK.

  • My version of Lightroom 6 is still showing trial version after Serial Number has been Installed.  I have tried re-installation but still have the same problem.  Could you please forward a solution to this problem.

    My version of Lightroom 6 is still showing trial version after Serial Number has been Installed.
    I have tried re-installation but still have the same problem.
    Could you please forward a solution to this problem.

    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 & above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record?

    I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record of the articles I intend to read?

    I'm currently dealing with this issue myself, except that my rMBP has NO articles in the reading list.  It's a brand new rMBP too, purchased just this week, with the 2.6 Ghz Processor & 16GB of RAM.
    Let's see what we can find.  I may just take it back to the Apple Store.

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • I disabled Sync history with IE , yet every time i look at my history in Firefox it shows all the IE places i visited , how do i stop this , so i can go to only my Firefox history , but still have IE and Firefox synced

    I use Firefox and Google Chrome for forums because they are faster than IE as IE(7) tends to hang a lot , so i have all my Favorites and everything synced with Firefox , as this is my main browser , but i do still use IE7 for some browsing , u went to Settings and unchecked the History , in the Sync section , but when i go to Firefox to view a forum topic i was looking at , recently , if i had gone to IE and visited any sites , then they show up in my history (for example Craigslist , i will look at several adds , and ALL of them are in my Firefox History) and push my Firefox history off the list so i have to go back to my favorites and start over , instead of being able to use my Firefox ONLY history so i can just go to those pages
    Is there anyway to fix/bypass this but still have Cookies and Favorites and such synced ?? , without the IE History knocking all my Firefox history off the list ??
    It's just annoying to have to go back from the beginning and search the topic i was in on a forum, because it was bumped off the list by any browsing i did in IE7, in between time
    Another issues since i am posting:
    I also have "Check Places" and it does not bring all the Favorites i have added in my IE Favorites over , the ones i did when i first installed it transferred , but any additional ones i have added to IE will not transfer , is there something wrong with Check Places ?? does it only transfer your Favorites 1 time , and not check for additions to the list then add them accordingly ???

    Only when i go to a different browser (like IE) after i clear it , then all that shows up is the pages i visited in IE , that is what bugs me , why is IE browsing history sowing up in Firefox ??
    Basically , i can clear the history in Firefox , and then for a example , go to Craigslist , using IE7 (launching it from a complete different Icon , in other words at that time i never open Firefox) , then after closing out , or even leaving open as it does not seem to matter , i go into Firefox , and hit History , and there is every place i visited in IE7 , on my History in Firefox

  • I tried dowloading Skype yesterday and my Safari browser crashed.  It gives the message "Safari quit while using the librooksbas.dylib plug-in.  I trashed Skype but still have the browser problem.  I also tried logging in under guest, and no Safari.

    I tried dowloading Skype yesterday and my Safari browser crashed.  It gives the message "Safari quit while using the librooksbas.dylib plug-in.  I trashed Skype but still have the browser problem.  I also tried logging in under guest, and still
    no Safari.

    Julie --
    Backing up QuickTime's advice --
    Unless your bank's website is insecure, you're fine.  Go up to the Safari "Search" bar and type in Rapport.  You'll be amazed.  It may  "work" on PCs, but definitely not Macs.  And it's not needed for Macs.

  • How can I "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight (and preferably visible, searchable, draggable in Mail App)?

    How can I "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight (and preferably visible, searchable, draggable in Mail App)?
    Background:
    I am using Mountain Lion and Mail App and running out of space on my small primary SSD drive (where I keep OS, apps, key user preferences/data and mail for speed). The mail data is the big variable (many GBs) and I want to "archive"/move some of the old mail to my 2nd drive inside the Mac. But I still want it searchable inside spotlight and preferably even inside Mail too. And I'd like to be able to still drag and drop old mails into this archive folder.
    What I've tried that seems to work:
    This seemed to work:
    1. Move the archive folder/mailbox to the 2nd drive/partition/folder (don't delete anything inside Mail App)
    2. Create a symbolic link from its new location to the original/old location
    This seems to work, it looks as "normal" and as if nothing happened inside Mail App but the folder now resides elsewhere and seems searchable etc. But I'm not sure that once caches refresh or over time with updates etc if stuff will break horribly or corrupt.
    Is that the right way to "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight and visible, searchable, draggable in Mail App?
    Thanks in advance!
    Cheers,
    Daniel

    I'm having a similar but slightly different problem. My company just migrated to Gmail, and it's saving mail drafts every 30 seconds into my Trash folder.
    I unchecked the "Show in IMAP" preference in the Gmail settings, but my Drafts folder completely disappeared. I went back and checked it and the folder reappeared (with my drafts still in there).
    I like the idea if starting an email on my laptop and having the option of finishing it on my iPhone or iPad, so only saving Drafts locally would not be ideal.

  • I accidentally deleted a purchased itunes song but still have it on my ipod.  Is there anyway to restore it to my pc?

    I accidentally deleted a purchased itunes song but still have it on my ipod.  Is there anyway to restore it to my laptop from the ipod?  I've seen others with a similar situation and the question was asked if it was still on the ipod but can't find a follow up to point me in the right direction.

    Use the Transfer Purchases command in iTunes.
    (58737)

  • Had to buy a new PC as the hard disk of the old one broke and lost all purchases, but still have them on the iPhone. How can I sync them back to the new PC in iTunes?

    Had to buy a new PC as the hard disk of the old one broke and lost all purchases, but still have them on the iPhone. How can I sync them back to the new PC in iTunes without losing them?

    You should be able to:
    Backup the device to the new installation
    Transfer your purchases into a newly authorized library
    Recover any other media using third party tools as suggested in this post from forum regular Zevoneer
    Restore the device from the backup
    This process should switch the association of the device to the new library, preserving the data and settings in your apps.
    May also be prudent to attempt a backup to iCloud directly from the device before you start... Settings > iCloud > Storage & Backup > iCloud Backup > On. It won't save any media but it would preserve the general account settings and documents in case anything goes wrong while you are trying to extract your other data.
    When you get it all fixed, make a backup!
    tt2

  • I want to set-up a network with our current two laptops for a family of 4 w/unique 4 profiles. I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e.mail/facebook). How best can I do this?

    I want to set-up a network with our current two laptops for a family of 4 with unique 4 profiles.  I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e. mail/facebook).  How best can I do this?

    iCloud Photo Sharing FAQ - Apple Support
    http://www.fatcatsoftware.com/iplm/Help/accessing%20an%20iphoto%20library%20on%2 0another%20mac.html

  • HT1386 I am re-building my iTunes library, but still have all the content on my iPod Classic.  I have just downloaded some songs from the store and want to add them to the iPod, BUT when i attempt this the message asks if I want to delete all content on t

    I am rebuilding my iTunes library, but still have all the old content on my iPod Classic.  I have just download some songs from the iStore and want to add them to the iPod, BUT when I try to sync it asks if I want to delete all content from the iPod and add only the material that I have just downloaded from the Store.  I do not want to lose my old content, because it is very extensive.

    You are trying to sync to other than the one iTunes library you can sync to. You can copy music from multiple library/computer if you use the manual method of syncing. That method is described here
    iTunes: Syncing media content to iOS devices and iPod
    If you want to make this computer/iTunes library your syncing computer/library you have to restore the iPod on this computer/library. Restoring erases the iPod.
    You can redownload most iTunes purchases by:
    iTunes: Syncing media content to iOS devices and iPod
    To copy other music to the computer see:
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
    BTW this is the iPod touch forum

  • HT204150 i have deleted all contacts in icloud but still have them on my iphone (which is backed up as well to iTunes) how can i restore the iphone data to the iCloud so it will resend it to my mac book and iPad?

    i have deleted all contacts in icloud but still have them on my iphone (which is backed up as well to iTunes) how can i restore the iphone data to the iCloud so it will resend it to my mac book and iPad? I have switched my iphone to airplane mode so it is not connected to the internet and so icloud can not wipe it at the moment.
    thanks roy

    There's a menu choice (I think under "Files") that lets you sync purchased items on a device back to itunes.  Look for that.
    iCloud does not store music.  If you want to do that you'd have to subscribe to itunes Match, but to get music to the match servers, you need the music in the itunes library on your computer.

Maybe you are looking for