Перейти к основному содержанию

All-in-one desktop computers from Apple. iMacs were equipped with Intel processors from 2006-2021.

7453вопросов Показать все

Applescript terminal extension issue

I'm running MacOS Sierra 10.12.2 and trying to create a script (using applescript) for flushing my dns (sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say flushed) but I can't save it with a .sh extension which is the necessary ext to open terminal. It's forcing me to save as .scpt (or another ext based on file type, but none of the options have .sh as an option). Please help!

Ответ на этот вопрос У меня та же проблема

Это хороший вопрос?

Оценка 1
Добавить комментарий

1 ответ

Наиболее полезный ответ

You can accomplish the same thing in a simple bash file written through any text editor (like TextEdit or TextWrangler). It should look something like (# signs indicate commented lines, and #!/bin/bash must be the first line of the file):

Block Image

Save as a .sh such as flushCache.sh. From terminal cd to the saved file's directory, then run sh ./flushCache.sh

Был ли этот ответ полезен?

Оценка 2

1 Комментарий:

Awesome, I'll try that when I get home. Thanks for getting back to me!

из

Добавить комментарий

Добавьте свой ответ

Jacob Carrillo будет вечно благодарен.
Просмотр статистики:

За последние 24часов: 0

За последние 7 дней: 0

За последние 30 дней: 0

За всё время: 38