1

How is it possible to load (with terminal attached window) sh program at OSx startup ?

I see a lot of article on launchctl but it's obviously not possible to open a terminal windows attached to the process. Specifically I am looking to run a specific script which is in the sh file (call for a python program. I have to see the echo / print of the program, so to have a terminal attached to the execution).

  • 1
    Do you want to run /bin/sh and have a shell to type in or are you looking to run a specific script in the sh language? – bmike Nov 14 '15 at 14:58
  • @bmike: I am looking to run a specific script which is in the sh file (call for a python program. I have to see the echo / print of the program, so to have a terminal attached to the execution). – Alexis G Nov 14 '15 at 15:01
  • launchd will allow to write to stdout – user151019 Nov 14 '15 at 15:17
  • Does it need to run on OS X startup or would it be enough to run it after a user logs in? – nohillside Nov 14 '15 at 15:17
  • @patrix: It's ok to run after each logs in. – Alexis G Nov 14 '15 at 15:19
2

Your use case is simple enough to just save your script to a file named with the .command file extension so that Terminal.app is chosen to open it. It needs to be user executable as well. Simply add that file to the user's Login Items in System Preferences.

The script is invoked with an ; exit tacked on to the end so you can see and copy the results before dismissing that window each time you login.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .