Zum Hauptinhalt wechseln

All-In-One-Desktopcomputer von Apple. iMacs waren von 2006 bis 2021 mit Intel-Prozessoren ausgestattet.

7425 Fragen Alle anzeigen

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!

Diese Frage beantworten Ich habe das gleiche Problem

Ist dies eine gute Frage?

Bewertung 1
Einen Kommentar hinzufügen

1 Antwort

Hilfreichste Antwort

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

War diese Antwort hilfreich?

Bewertung 2

1 Kommentar:

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

von

Einen Kommentar hinzufügen

Antwort hinzufügen

Jacob Carrillo wird auf ewig dankbar sein.
Seitenaufrufe:

Letzte 24 Stunden: 0

Letzte 7 Tage: 0

Letzte 30 Tage: 0

Insgesamt: 38