Frequently Asked Questions on Unix/Mac OS X
  1. How to intall a downloaded file for Ch in Mac OS X?
  2. How to run command/file in the current directory?
  3. How to get started in Mac OS X?
  4. How to make Ch run as the default shell in the Terminal app on the Mac?
  5. How to setup AquaTerm to display plots in Ch?

Q: How to intall a downloaded file for Ch in Mac OS X?

If you downloaded a file for Ch, say chevaluation-6.0.0.macosx10.ppc.tar.gz for Ch Professional Evaluation Edition version 6.0.0, you can install it with the following steps.

  • Left click "Go" at the top menu, and then left click "Utilities" on the pull-down menu.
  • Under Utilities window, left double click "Terminal". A terminal will pop-up.
  • By default, the current directory of the terminal is /Users/your_account_home/Desktop. Assume you have downloaded the file chevaluation-6.0.0.macosx10.ppc.tar.gz on your desktop. Otherwise, you need to change to the directory where the downloaded file is located by typing the command 'cd' followed by the directory name such as 'cd /some/dir/name/for/your/downloaded/file'.
  • Type the following commands to install the software. gzip -cd chevaluation-6.0.0.macosx10.ppc.tar.gz | tar -xvof - cd chevaluation-6.0.0.macosx10.ppc ch ./install.ch
  • For Ch Student Edition, the downloaded file name starts with chstudent instead of chevaluation. For Ch Standard Edition, the downloaded file name starts with chstandard instead of chevaluation. The version number 6.0.0 will be different if it is not version 6.0.0.

    Q: How to run command/file in the current directory?

    If you have a file named "foo.ch" in the current directory, run command "chmod 755 foo.ch" first if foo.ch is not an executable file.

    For security reason, by default, the current directory is not in the command path. There are two ways to run "foo.ch"

    • You may run the command using "./foo.ch"
    • Or you can add the current path in the command path first by running "ch -d", which will copy startup file ".chrc" to your home directory. Then, use an edit such as "vi" to edit ".chrc" in your home directory. Remove comment "//" from
      //_path = stradd(_path, ".;");
      Save ".chrc" and restart Ch by typing "ch".
      Now, you can run the command "foo.ch" in the current directory.
    Q: How to get started in Mac OS X?

    The use of Ch is similar to C-Shell, BASH or Perl in MacOSX.

    Getting started in Ch, you must start Unix terminal from the menu of Applications/Utitiles/Terminal, then type

               ch
               help
    
    For more information, please check Ch Installation Guide and Ch User's Guide.

    Q: How to make Ch run as the default shell in the Terminal app on the Mac?

    In the Terminal application:

    1. Go to the "Terminal/Preferences" menu
    2. Select the "Execute this command" button
    3. Enter "/bin/ch" as the command
    4. Close the preferences window
    
    Now any new shell (Apple-N) opened will be a Ch shell.
    To save the shell with all the preferences, select "File/Save", and will save it to "~/ Library/Application Support/Terminal" as a .term file.
    This can be opened from the "File" menu so all your prefs are as you saved them.

    Q: How to setup AquaTerm to display plots in Ch?

    Plots in Ch Professional Edition can be displayed using either X11 or AquaTerm.

    Plots in Ch are displayed using X11 by default. Installation instructions for X11 can be found by searching for "X11 install" on Apple Computer's web site.

    AquaTerm is an open source application for Mac OS X that provides a GUI interface for plotting programs. To use AquaTerm for displaying plots in Ch, follow the instructions below to set it up.

    1. Downloaded AquaTerm from the internet at its Web site and install it.
    2. Create a system startup file .chrc in your home directory by command ch -d
    3. Add the statement putenv("GNUTERM=aqua"); inside the startup file .chrc in your home directory. A line may already exist and just need to be uncommented. If this is the case, just uncomment the line by getting rid of the "//" at the beginning of the line.