- Terminal Command
open -n "/Volumes/MacHD Storage/Applications/Stata/StataSE.app"
Replace the path with your path, and the name of STATA application when necessary. Last, press Enter.
2. Alias
If you feel annoying to type the length command each time when you want to run another instance of STATA, you can save it as an alias. First, open the terminal, then type in the following command
sudo nano /.bash_profile
This command allows using command line based text editor GNU nano to edit the profile file. Remember this has to be done under the superuser privilege so you will need to type in your superuser password. Second, type in the following command:
alias STA=open -n "/Volumes/MacHD Storage/Applications/Stata/StataSE.app"
This step is to make an alias of the command scripts in profile, and the alias is called STA.
Press CTL+O to save the file, and press CTL+X to exit the editor. Then log out and log in again. Next time when you need to run another instance, just open the terminal and type in STA, and press Enter.
3. Executive File
You can also make an executive file that is doable in macOS (UNIX). Open any coding text editor, such as the BBEdit, Notepad++ or even Xcode, create a new text file, set the encoding format to be UNIX LF, set the text profile to be "Unix Shell Scripts", then copy and paste the following code (change the path when necessary) to the text editor:
#!/bin/bash
open -n "/Volumes/MacHD Storage/Applications/Stata/StataSE.app"
Then save it as a .sh file. Open Finder, find the .sh file you just saved and remove ".sh" from the name, then you will notice that the text file becomes an executive file. Next time when you need to run another instance, just double click the executive file.
(Or:
If it does not work, you will need to use a formal way. Suppose you named the ,sh file as STA_MI.sh, put in on the desktop. Open terminal, type in:
sudo chmod +x "~/Desktop/STA_MI.sh"
Then this file will be assigned an executable permission.)
I hope these methods help. You can leave any questions regarding this in the comment section, and I will answer them when possible.
References:
1. https://www.stata.com/statalist/archive/2010-08/msg00113.html
2. https://www.techradar.com/how-to/computing/apple/terminal-101-creating-aliases-for-commands-1305638
3. https://www.macobserver.com/tmo/article/os-x-how-to-convert-a-terminal-command-into-a-double-clickable-desktop-file
No comments:
Post a Comment