cd ~/for-solaristo go into the directory. Then enter the command
ls -lto make sure you have arrived at the right place. You should see this GettingStarted file and the five applications: xfst, lexc, lookup, tokenize, and twolc. The display should look something like this:
-rw------- 1 myname staff 13417 Mar 11 18:22 GettingStartedSolaris.htmlThe -rwx------ signature starting each line indicates that you (the owner) have the full rights to the file (read, write, and execute). Sometimes file permissions are not preserved when files are copied. If you see something other than -rwx------ in the beginning of the last five lines, enter the command
-rwx------ 1 myname staff 735440 Aug 11 2002 lexc
-rwx------ 1 myname staff 457344 Jun 13 2002 lookup
-rwx------ 1 myname staff 274560 Jun 13 2002 tokenize
-rwx------ 1 myname staff 654804 Jul 19 2002 twolc
-rwx------ 1 myname staff 791296 Sep 28 09:17 xfst
chmod 700 *to fix the permissions. You (and only you) should be able to read, write, move, or execute these files.
./xfst(note the period and the slash), the xfst application will start and you will see the xfst[0]: prompt. To try out a simple command, you can type
read regex a b c;to make your first network. This is just a test; you can immediately quit from xfst and return to Solaris with the command exit. To make the programs accessible from any Terminal window, they should be copied to a directory that is on your "path", a list of directories that Unix searches to find the executable programs for you. Enter the command
echo $pathto see which directories you have on your path.
cd ~/for-solarisIf you don't already have a ~/bin directory (~/ stands for the path from the top of the file system into your home directory), we recommend that you make one and move the programs there. To do that, enter the commands
mkdir ~/binThe mkdir command creates the folder bin in your home directory. If you already have a ~/bin directory, the mkdir command will tell you so and do nothing. The mv command moves all the files in your current ~/for-solaris directory into the ~/bin directory. To verify that all went well, enter the command
mv * ~/bin/
ls -l ~/bin/You should see the five programs in their new location.
echo $pathshould show something terminating in ~/bin or myname/bin in its output (different Solaris installations store the user home directories in different locations). If that is the case, enter the commands
rehashto make sure everything is installed correctly.
which xfst
ls ~/.cshrcIf the .cshrc file exists, bring it up in a text editor and add the line
set path = (~/bin $path)and save the .cshrc file. If the file does not yet exist, enter the following three commands at the terminal prompt
cat > ~/.cshrcwhere ^D stands for control-D. You should now have a ~/.cshrc file that adds ~/bin to your path in every newly launched Terminal application.
set path = (~/bin $path)
^D
source ~/.cshrcto add the ~/bin directory to the path in the current Terminal, followed by the commands
rehashIf the which command comes back with a path to the location where xfst was installed, all is well and you are done. You can now launch xfst with the command xfst in any new Terminal window. If xfst works, the other four applications, lexc, lookup, tokenize, and twolc, will also launch properly.
which xfst
cd ~/bin
rm lexc lookup tokenize twolc xfst
Because of its Unix origins, all the applications assume that lines in text input files end with the Unix newline character "\n". Input files that terminate lines with "\r" (Macintosh) or with "\r\n" (Windows, DOS) cannot be processed with the CD versions of the software. If you have a source file created on a Macintosh, you can replace the end-of-line characters in Unix with the command
tr "\r" "\n" < inputfile > outputfileThe command
tr -d "\r" < inputfile > outputfileconverts a Windows/DOS document into Unix format.
Only ISO-8859-1 (= Latin-1) character encoding is supported by the CD versions of the software. 16-bit Unicode characters (UCS-2) are handled internally but they cannot be entered directly as input. For example, the Hebrew letter Alef can be represented as "\u05D0" in a regular expression where "\u" indicates that the following four Hex characters encode a Unicode symbol but the symbol will not be printed as the proper Hebrew character even if the computer has a Hebrew font installed.In the near future, we will make available new versions of xfst, lexc, lookup and tokenize that are aware of different end-of-line conventions and able to process UTF-8 encoded Unicode files. Please check out the book web site, http://www.fsmbook.com, for updates.