Execute script under OSX spotlight

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.