I needed my MacBook Pro to set the volume level to zero each time it was shut down. That way the annoying startup chime would be muted when I turn on the computer.

Solution:

I created the file /etc/rc.shutdown.local (a file that executes when the computer is shut down) and placed into it, a text command that changes the volume level to zero (0).

Prerequisites:
You must know the password for the administrative user.

Process:
1. Open the Terminal app
2. type the command sudo vi /usr/bin/rc.shutdown.local
3. type in the administrator when prompted
4. tab the “i” key to change to insert mode
5. Enter in the following text:
#!/bin/sh
/usr/bin/osascript -e “set volume 0”

6. tap the esc key (escape key)
7. type a colon character, an x character, and the enter key
8. make this file executable by typing the command: chmod +x /etc/rc.shutdown.local

Test your script:
Change your macintosh’s volume to anything but 0
Enter the command: /etc/rc.shutdown.local

Expected result:
Computer’s volume is set to zero (0)
A message may be displayed on the Terminal window that can be ignored.

Real test:
Set your Macintosh’s volume to anything but zero (0)
Restart your computer.

Expected result
The startup chime should not be heard