Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting up terminal with Mac

    Hi,

    I am using Maverick and recently installed Stata-MP. I want to be able to type stata in the terminal (or any other alias), and when stata opens, it is in the directory that I open it in. For example, if I am in /Users/iwstephens/data/, typing "stata" will open and stata's path will already will be in that directory. I know how to set up an alias to open up stata, but when stata opens, stata is always in the home directory.

    In the past I would use a remote computer and just type "xstata" and the graphical interface would open up and stata would be in the same directory as my terminal. However, my installation does not seem to include an xstata.

    Thanks

    Ian

  • #2
    Not sure about Maverick, in Windows you do this with:
    1. Add path to Stata's home folder to the PATH variable;
    2. Create a stata.bat file in Stata's home folder with one line:
    Code:
    statamp-64.exe cd "%CD%"
    After that typing stata in the command line would bring in Stata's window and the current directory will be the one from where you typed stata.

    Hope this is portable to Maverick. Best, Sergiy Radyakin.

    Comment


    • #3
      Put
      alias gui-stata='env STATACMD=True open -n /Applications/Stata/StataSE.app'
      in your .bash_profile file, where you substitute the name of the StataMP application in place of StataSE.app. Then put something like
      Code:
          if (`"`:environment STATACMD'"'=="True") {
              cd `"`:environment PWD'"'
          }
      in your profile.do file. After that, typing gui-stata should launch an instance of Stata with working directory set to the directory from which the command was issued.
      Last edited by Phil Schumm; 02 Jun 2014, 04:47.

      Comment

      Working...
      X