Execute scripts under osxspotlight
I am used to some bash operations in Linux. I often put a series of commands into a sh file. osx belongs to the Unix series and can perform the same operations, however, it cannot be executed in spotlight after being added to the environment variable. After google finds that you need to change the suffix. sh of the previous file to. command, and then you can perform quick operations. Next, we end a script for detaching a disk.
1 2 3 4 5 6 7 8 9 10 11
|
#! /Bin/bash # Umount all disk privileges t disk1
Sync
For loop in 'df-h | grep "dev \/disk" | grep-v disk1 | awk {'print $1 '}' Do Diskutil unmount $ loop Done
Say "unmount successfully! " |
The above code uninstalls the mounting device except the local disk disk1. In osx, use diskutil instead of the umount command in Linux. After the unmounting is completed, the audio playback is uninstalled successfully.
For more articles, go to xiaopengxuan.