Aller au contenu principal

Ordinateurs de bureau tout-en-un d'Apple. Les iMac ont été équipés de processeurs Intel de 2006 à 2021.

7452 questions Voir tout

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!

Répondre à cette question J'ai le même problème

Cette question est-elle utile ?

Indice 1
Ajouter un commentaire

1 Réponse

Réponse la plus 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

Cette réponse est-elle utile ?

Indice 2

1 commentaire:

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

par

Ajouter un commentaire

Ajouter une réponse

Jacob Carrillo sera éternellement reconnaissant.
Nombre de vues :

Dernières 24 heures : 0

7 derniers jours : 0

30 derniers jours : 0

Total : 38