Hamilton LaboratoriesHamilton C shell 2012User guide

Common problems

Oregon Coast

Common problems
Previous | Next

When I try to start the C shell from a shortcut, it dies and goes away before I can read its messages.

Your shortcut probably has an error in the Target field. Right-click the icon for Hamilton C shell and click properties to bring up an edit window. Check the command line options or re-run setup to repair your installation.

The shell won’t run my new program.

Path hashing can sometimes produce surprising results if you create a newer version in your current directory of a command that already exists in another of your path directories. The shell won’t know you’ve done this; its hash will still only list the older version. To overcome this problem, use either the rehash or unhash commands.

The shell won’t execute commands in the current directory.

You need to add the current directory to the list of directories in the PATH variable. cmd.exe always checks the current directory before looking in any of the PATH directories; Hamilton C shell checks the current directory only if it’s explicitly listed in the search path. This is why the standard startup.csh file includes a few lines at the beginning to add the ., bin and samples directories to the path if they’re not already listed.

The shell keeps running the old version my shell procedure.

If you define a shell procedure with proc in a .csh script file and then execute the script, the procedure is compiled into an internal form that’s much faster to run and it’s kept around in memory to make it run the next time even faster. If you change the text in the script file but don’t explicitly throw away the old definition using unproc, the C shell won’t know it’s supposed to recompile.

The shell won’t run any cmd.exe internal commands.

Most probably, the shell is unable to find your startup.csh file when it starts up. This is the file that should hold the aliases the shell uses to intercept cmd.exe’s builtin commands. Check to see that your HOME variable is set to the directory where you’ve placed startup.csh and that your startup.csh file isn’t garbled.

copy or rename *.* doesn’t work right.

copy, xcopy, rename and del like to do their own wildcard expansion. To make them work sensibly, be sure your startup.csh file includes and that you use the aliases and procedure definitions we supply to intercept these commands to turn off shell wildcarding just long enough to run them. These definitions can also serve as a model if you discover other applications that must do their own wildcarding. For more information, refer to the discussion at the end of the wildcarding chapter.

The -! option doesn’t work.

The exclamation point is a special character for the shell. The shell lets you pick up text out of previous commands using history references that begin with ! followed by a string that tells what text you’re retrieving. To avoid having an exclamation confused as a history reference, be sure the exclamation is at the end of a word, so the next character is a space or a tab.

grep '^foo' doesn’t work.

The circumflex has special meaning as the escape character to the C shell, even inside quotes. If you want to pass a literal ^ to grep (or anything else) from the command line, you must type ^^ unless the immediately preceding character was [.

du, pwd and vol waste time sitting and spinning when they hit a removable drive that’s empty.

If you have a removable media device other than A: or B:, these utilities will normally try to report them. That’s probably not you want, at least not usually; you can specify just the set of drives you do want reported using the DRIVEMASK environmental variable.

cd /foo doesn’t work.

Hamilton C shell tries to serve users coming both UNIX and MS-DOS backgrounds. To do this, the C shell and all the utilities accept command line options starting with either - (UNIX-style) or / (DOS-style). They also recognize filenames typed with either forward or backward slashes. When you type cd /foo, the C shell guesses wrong and thinks you’re trying to give it a command line option that it can’t recognize.

If this is really not what you intend, set the SWITCHCHARS environmental variable to just the specific characters you want recognized. E.g., you might include this in your startup.csh file to cause only - to be recognized: setenv SWITCHCHARS = -.

I can’t set my own screen colors.

Yes, you can. But you cannot do it just by embedding ANSI escape sequences into your prompt since the C shell will immediately reset the colors back to what it thinks they should be. To set your own preferences for screen colors, you must use the COLORS environmental variable. See the chapter on customizing the shell or the colors.csh script in the Samples directory for more information.

Alt-Enter doesn’t work to grab commands from the history list.

Alt-Enter is gobbled up by the system as a keystroke combination used to signal that an application should be toggled back and forth between the desktop and a full-screen session. Under the these systems, you’ll have to type Ctrl-Shift-Enter instead.

I can’t wildcard filenames with $'s, spaces or quotes in them.

Yes, you can. To do so, just quote or escape the special characters. E.g., to get all the files that begin with $, you might type ^$* or '$'*.

Previous | Next

Getting started with Hamilton C shell

Hamilton C shell, as it first wakes up.

Getting started with Hamilton C shell

A first few commands.

You can set the screen colors to your taste.

You can set the screen colors to your taste.