问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/30030473/utilizing-the-say-command-in-terminal