#!/bin/sh MENUEXTRAS="/System/Library/CoreServices/Menu Extras" CGSESSION="$MENUEXTRAS/User.menu/Contents/Resources/CGSession" if [[ -z $1 ]]; then "$CGSESSION" -suspend else USERID=`id -u $1`; if [[ -z $USERID ]]; then exit -1; fi; "$CGSESSION" -switchToUserID $USERID fi;
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
fast user switch from the command line (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» repair disk permissions from... in shell osx cli terminal
» check for file collisions wh... in shell osx cli terminal
» Boot in verbose mode in shell osx cli terminal
» Lock the keychain when idle in shell osx cli terminal
» Create an ecrypted sparse di... in shell osx cli terminal
» /etc/sysctl.conf in shell osx cli terminal
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails