Shell Command for Mac Sleep?

jaime.flores

macrumors newbie
Original poster
Oct 29, 2007
3
0
Hey, I wanted to know if there is simple shell/terminal (non-applescript) command for putting a mac to sleep. I've been looking around but I can't seem to find one, or any documentation that might point me to one.

My aim is to have Carbon Copy Cloner put my computer to sleep after it finishes a clone. I'm trying to do it through a shell script that I can point CCC to through the "Advanced Settings" in the app.

I appreciate any help.

--Jaime

P.S. To Admins: I wasn't sure which forum was more appropriate for this thread, this forum or the Mac Programming forum. If the latter is more appropriate, please move my thread. Thanks.
 

rion

macrumors newbie
Dec 14, 2007
1
0
/usr/bin/osascript -e 'tell application "System Events" to sleep'

will do the trick. osascript runs applescript code from the command line.
 
Comment

jaime.flores

macrumors newbie
Original poster
Oct 29, 2007
3
0
/usr/bin/osascript -e 'tell application "System Events" to sleep'

will do the trick. osascript runs applescript code from the command line.
Haha, I'd given up on this post. Thank you for replying :D

--Jaime
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.