Ana içeriğe geç

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

7424 Soru Tümünü görüntüle

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!

Bu soruyu yanıtla Ben de bu sorunu yaşıyorum

Bu iyi bir soru mu?

Puan 1
Yorum Ekle

1 Cevap

Filtre ölçütü:
En Yararlı Yanıt

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

Bu yanıt yardımcı oldu mu?

Puan 2

1 Yorum:

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

tarafından

Yorum Ekle

Yanıtını ekle

Jacob Carrillo sonsuza kadar minnettar olacak.
İstatistikleri Görüntüle:

Son 24 Saat: 0

Son 7 gün: 0

Son 30 gün: 0

Her zaman: 38