Mac OS X-ejecutar shell script desde la interfaz gráfica de usuario del escritorio


Puede crear un script de shell o un script de Python o Ruby y ejecutarlo en el Mac utilizando "Terminal" ... si tiene Finder abierto, y hace clic en el icono del archivo que contiene el código fuente de un script de shell guardado, ¿hay alguna manera de ejecutar ese script, en lugar de abrirlo en mi editor de texto ?

Author: Paul R, 2010-06-10

3 answers

Sí - simplemente ponga un sufijo .command en el script.

Nota: asegúrese de que el script es ejecutable, por ejemplo,

$ chmod +x myscript.command
 73
Author: Paul R,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-07-16 08:04:14

Otra alternativa rápida es la herramienta ornitorrinco ( http://sveinbjorn.org/platypus / ). Gratis y bueno, pero puedes donar, si quieres.

Platypus es una herramienta de desarrollo para el sistema operativo Mac OS X. Crea aplicaciones nativas de Mac OS X a partir de scripts interpretados como shell scripts o programas Perl, Ruby y Python. Esto se hace envolviendo el script en un paquete de aplicaciones junto con un binario ejecutable nativo que ejecuta el script.

 3
Author: user6917,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-27 10:45:04

Simplemente asocie los archivos .sh con Terminal.app

 2
Author: namon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-03 20:14:11