Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

ZSH Local or Remote?



Hi all,

Does anyone have a nice slick function to determine whether the machine you are logged on to is local or remote? Basically you will get the tty of the current shell and grep for this in who or pinky. If you get :[0-9] you must be local.

Clearly this isn't bullet proof but I was wondering if any of you had a really slick way of figuring this out..

Why you ask? If I am locally logged in I want to run keychain. If a person is remote AND the machine is a trusted_machine I want to run keychain. Otherwise don't...

Keep in mind this needs to run multiplatform - so be carefull which command you use..





---

Steven Klass

sklass@xxxxxxxxxxxxxxx
(480) 988-5657



Messages sorted by: Reverse Date, Date, Thread, Author