Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Need help with a very simple shell script...

Need help with a very simple shell script...
Thread Tools
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Jan 5, 2005, 03:20 PM
 
I'm using Bombich's Login Window manager software to help create a custom login message for students to "Sign In" before using the computers. I then wanted to put a shell script on log out that just pops up a message that says "Please remember to sign out."

Can someone point me to (or maybe just make one?) a script that does that? Just pops up a dialog window with a custom message and an OK button before the computer logs out.

Thanks a bunch.
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jan 5, 2005, 03:32 PM
 
*knuckles crack*
Code:
osascript -e 'tell app "System Events"' -e 'beep' -e 'display dialog "Remember to Sign Out"' -e 'end tell'
This all has to be on one line, and I am not sure how it is going to like being part of a logout script... but it is start.
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Jan 5, 2005, 03:42 PM
 
I'll give it a shot, thanks.

Originally posted by larkost:
*knuckles crack*
Code:
osascript -e 'tell app "System Events"' -e 'beep' -e 'display dialog "Remember to Sign Out"' -e 'end tell'
This all has to be on one line, and I am not sure how it is going to like being part of a logout script... but it is start.
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Jan 5, 2005, 03:48 PM
 
Seems to be a different format.

The example scripts are more along the lines of C or something.

http://www.bombich.com/mactips/scripts.html
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Jan 5, 2005, 03:54 PM
 
Hah, nevermind. I didn't realize you could make a script in any script language.

Thanks, it worked.
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jan 5, 2005, 06:45 PM
 
Actually, both the Bombich scripts and Larkost's are written in the same shell language. Larkost's just calls the osacript AppleScript interpreter.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:57 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2