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.
-
Downloaded AquaTerm from the internet at
its Web site
and install it.
-
Create a system startup file
.chrc
in your home directory
by command
ch -d
-
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.