Salta al contenuto principale

Computer desktop all-in-one prodotti da Apple. Gli iMac sono stati dotati di processori Intel dal 2006 al 2021.

7452 Domande Visualizza tutte

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!

Rispondi a questa domanda Anch'io ho questo problema

Questa è una buona domanda?

Punteggio 1
Aggiungi un commento

1 Risposta

Risposta Più Utile

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

Questa risposta è stata utile?

Punteggio 2

1 Commento:

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

da

Aggiungi un commento

Aggiungi la tua risposta

Jacob Carrillo sarà eternamente grato.
Visualizza Statistiche:

Ultime 24 Ore: 0

Ultimi 7 Giorni: 0

Ultimi 30 Giorni: 0

Tutti i Tempi: 38