OS X 10.10

From a bash script I launch an app, but I only want this behavior if the user 
is locally logged in at the console. If the user has ssh’d into the machine and 
is running the bash script, the app launch should not be attempted (it will 
fail since the user doesn’t ‘own’ the screen).

I’ve tried:

    if [ -z “PS1” ]

and

    case “$-“ in

but they don’t distinguish this difference, and always return false. 

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?
-Carl

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

Reply via email to