On Wed May 20 2015 19:43:40 [email protected] said:
> 
> On 2015-05-20 16:14 , Carl Hoefs wrote:
>> I could check for the existence of the $TERM_PROGRAM or $SSH_CLIENT env 
>> vars, but I’m thinking there must be a better way to do this?

> consensus on stackexchange is to test the env vars

Those are not OS X specific answers.

This will tell you if the current user owns a Finder process:

ps -U"$USER" -co command | grep "\bFinder\b”

But that doesn’t tell you if the user of the current session is ssh or not 
(though in many cases this may be more than enough).

$SSH_CLIENT seems pretty reliable, but I’ve not done a lot of testing.

-- 
A man without religion is like a fish without a bicycle.

_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to