Differences between revisions 1 and 2
Revision 1 as of 2007-08-27 15:39:09
Size: 3035
Editor: lab1
Comment:
Revision 2 as of 2007-08-27 16:08:50
Size: 4149
Editor: lab1
Comment:
Deletions are marked like this. Additions are marked like this.
Line 44: Line 44:

We also need to change our path to add the directory with the corpus tools. This needs to come somewhere after the corpus related variables we just set, as it references one of them.
{{{
# PATH addition
set path = ($path $home/bin $HLP/bin)
}}}

==== Optional changes ====
Near the bottom of the CS provided {{{.cshrc}}} there is a section that starts with the comment {{{ # add all INTERACTIVE commands here, specifically, any stty or prompt setting}}}. In between the {{{if}}} and {{{endif}}} following that, you can set some nice optional settings.

You may or may not like the default command prompt that the CS environment uses. Luckily the prompt can be changed. The following is a nice prompt:
{{{
set prompt = "%n@%m:%~ % "
}}}
This shows your username @ computer name : working directory %

If you worry about accidentally deleting files, add the following to have the system ask permission before deleting each file:
{{{
alias rm 'rm -i'
}}}
If this gets annoying you can always type {{{unalias rm}}} at the command line to turn off interactive mode for {{{rm}}} until you logout.

Setting up your Unix environment

Most of the Unix interaction in the lab will be on the command line. Graphical desktops exist for Unix, including [http://www.gnome.org/ GNOME] and [http://www.kde.org/ KDE] on top of [http://www.x.org/ X11], and MacOS X, where the Unix underpinnings are thoroughly hidden most of the time.

There are two command shells that you are going to encounter on our systems. On the Macs you will be using the Bourne Shell (sh or more likely its successor bash or Bourne Again Shell) unless you change your shell, and on the Linux systems in CS you will be using the C Shell (csh or more likely its successor tcsh or Tenex C Shell). For most day to day use they are functionally equivalent. However they have very different scripting languages and ways of setting up the environment. The main concept that we need to worry about for setting up the environment is how to set environmental variables.

1. Bash

2. C Shell

The C Shell was originally written by Bill Joy at UC Berkeley in the mid-1970s. (This should sound familiar if you've read the [wiki:Self/HlpLab/UnixEditors/Vim Vi(m)] page.) It was given the name because the syntax of its scripting language is designed to be similar to the C programming language. Almost all modern systems (including the CS system here at Rochester) actually use the Tenex C Shell, which is a heavily extended rewrite of the original.

2.1. .cshrc

At login the system automatically runs a file in your home directory called .cshrc to set up the environment. You will need to edit this file to be able to use the corpus tools. Below are some shell commands you'll need to know and then some settings you'll want to change.

2.1.1. comments

Anything after a # is a comment. This is useful for documenting why you are doing something or to temporarily prevent the evaluation of a line of the file.

2.1.2. set and unset

set and unset are used to manage built-in shell variables.

2.1.3. setenv and unsetenv

setenv and unsetenv are used to manage environment variables.

2.1.4. alias and unalias

alias and unalias are used to alias commands to other commands.

2.1.5. Changes you need to make

Somewhere near the top of the file, but after the source /usr/staff/lib/defaults/system.cshrc line, add the following lines for environment variables related to the corpus tools:

# Corpus related variables
setenv HLP /p/hlp
setenv NLP /p/nl
setenv TOOLS $HLP/tools
setenv TDT $TOOLS/TDT
setenv TDT_DATABASES $TDT/databases
setenv TGREP2ABLE $HLP/corpora/TGrep2able
setenv TGREP2_CORPUS $TGREP2ABLE/brown.t2c.gz

On the last line with TGREP2_CORPUS set the value of the part after the final forward slash to one of the corpora in the /p/hlp/corpora/TGrep2able/ directory. For this example I've used the Brown corpus.

We also need to change our path to add the directory with the corpus tools. This needs to come somewhere after the corpus related variables we just set, as it references one of them.

# PATH addition
set path = ($path $home/bin $HLP/bin)

2.1.6. Optional changes

Near the bottom of the CS provided .cshrc there is a section that starts with the comment  # add all INTERACTIVE commands here, specifically, any stty or prompt setting. In between the if and endif following that, you can set some nice optional settings.

You may or may not like the default command prompt that the CS environment uses. Luckily the prompt can be changed. The following is a nice prompt:

set prompt = "%n@%m:%~ % "

This shows your username @ computer name : working directory %

If you worry about accidentally deleting files, add the following to have the system ask permission before deleting each file:

alias rm 'rm -i'

If this gets annoying you can always type unalias rm at the command line to turn off interactive mode for rm until you logout.

UnixEnvironment (last edited 2011-08-10 17:28:48 by echidna)

MoinMoin Appliance - Powered by TurnKey Linux