I've been trying to figure out how to run a bash command in a new Max OS X Terminal.app window. As, an example, here's how I would run my command in a new bash process:
bash -c "my command here"
But this reuses the existing terminal window instead of creating a new one. I want something like:
Terminal.app -c "my command here"
But of course this doesn't work. I am aware of the "open -a Terminal.app" command, but I don't see how to forward arguments to the terminal, or even if I did what arguments to use.
Partial solution:
Put the things you want done in a shell-script, like so
And don't forget to '
chmod +x file
' to make it executable. Then you canand it will run in a new window. Add '
bash
' at the end of the script to keep the new session from exiting. (Although you might have to figure out how to load the users rc-files and stuff..)I've been trying to do this for a while. Here is a script that changes to the same working directory, runs the command, and closes the terminal window.
Here's yet another take on it (also using AppleScript):
see: codesnippets.joyent.com/posts/show/1516