Ir para o conteúdo principal

Computadores de mesa tudo-em-um da Apple. Os iMacs foram equipados com processadores Intel de 2006 a 2021.

7455 Perguntas Visualizar todos

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!

Responder a esta pergunta Também tenho esse problema

Esta é uma boa pergunta?

Pontuação 1
Adicionar um comentário

1 resposta

Pergunta mais ú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

Esta resposta foi útil?

Pontuação 2

1 comentário:

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

por

Adicionar um comentário

Adicionar a sua resposta

Jacob Carrillo será eternamente grato(a).
Exibir estatísticas:

Últimas 24 horas: 0

Últimos 7 dias: 0

Últimos 30 dias: 0

Duração total: 38