Ga door naar hoofdinhoud

Alles-in-één desktopcomputers van Apple. iMacs waren van 2006-2021 uitgerust met Intel-processors.

7453 Vragen Bekijk alle

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!

Beantwoord deze vraag Dit probleem heb ik ook

Is dit een goede vraag?

Score 1
Voeg een opmerking toe

1 Antwoord

Het nuttigste antwoord

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

Was dit antwoord nuttig?

Score 2

1 Opmerking:

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

door

Voeg een opmerking toe

Voeg je antwoord toe

Jacob Carrillo zal eeuwig dankbaar zijn.
Weergavestatistieken:

Afgelopen 24 uren: 0

Afgelopen 7 dagen: 0

Afgelopen 30 dagen: 0

Altijd: 38