Saltar al contenido principal

Ordenadores de escritorio todo en uno de Apple. Los iMac estuvieron equipados con procesadores Intel entre 2006 y 2021.

Preguntas 7456 Ver todo

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!

Contesta esta pregunta Yo también tengo este problema

Es esta una buena pregunta?

Puntuación 1
Agregar un comentario

1 Respuesta

Respuesta Más Útil

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

Fue útil esta respuesta?

Puntuación 2

1 comentario:

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

- de

Agregar un comentario

Añadir tu respuesta

Jacob Carrillo estará eternamente agradecido.
Ver Estadísticas:

Ultimas 24 horas: 0

Ultimos 7 días: 2

Ultimos 30 días: 2

Todo El Tiempo: 40