Get used to some of the Linux bash operations, often put a series of commands into a sh file, OSX belongs to the Unix family, but also can be the same operation, but added to the environment variable but can not be used in spotlight execution. Google a bit, found that the previous file suffix. SH is modified to. command, then it can be done quickly, the following end a script to unmount the disk.
1 2 3 4 5 6 7 8 9 10 11
|
#!/bin/bash #umount all disk except Disk1
Sync
For loop in ' df-h | grep "Dev\/disk" | Grep-v Disk1 | awk {' print '} ' Do Diskutil unmount $loop Done
Say "Unmount successfully!" |
The above code is to remove the local disk Disk1 outside the Mount device uninstall, in OSX, using Diskutil instead of the Umount command under Linux, after the uninstallation is complete, the voice playback uninstall succeeded.
For more articles, please visit the little Fat Xuan.