Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there any way to make terminal execute the "say" command when I login to my laptop? I want it to have a greeting when I log in. Is that possible at all?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
191 views
Welcome To Ask or Share your Answers For Others

1 Answer

Sure, paste the following into a file called greet in your HOME directory:

#!/bin/bash
say "Hello"

Then start the Terminal, and type

chmod +x greet

to make it executable.

Then go to the Apple menu at top-left of the screen, and click System Preferences->Users & Groups, then select your username, and on the right click Login Items. Click the little + sign and add the file called greet from your HOME directory.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...