Ok... I've been searching for an answer to this for a while and can't seem to find any good examples, so I thought I'd break down and ask.
How can I create a shell file (.command) in OSX that I can just double-click on which:
- Opens a new Terminal window
- Runs a few commands
- ... and stays active so I can continue to run other things!
My goal is to setup various environments using individual .command files, which will each set variables and run certain command line tools, and then remain open to manually run other commands. I currently have one like this:
#!/bin/sh
export MY_VAR_A="blah A"
export MY_VAR_B="blah B"
cd /Users/
... and this doesn't work. It just opens a Terminal window with this output:
Last login: Sat Aug 17 12:52:15 on ttys000
unknown60c5470527e4:~ me$ /Users/me/Documents/test.command ; exit;
logout
[Process completed]
Is there a better (or just different) way of accomplishing what I want? Or do I just need to adjust something simple in my current .command file?