The UNIX environment
Reasons why GENSYS runs under UNIX:
- The GENSYS software package is a very old, the beginning of the development started already in 1971.
- UNIX was from the beginning designed for large programs, large computers, multiuser and multitasking.
Windows programs were very long time limited to 640kb.
- UNIX filenames may contain up to 255 characters, with a maximum path of 4096 characters.
Windows programs were very long time limited to 8 + 3 characters, with a maximum path of 256 characters.
- UNIX is very stable operating system because it is designed for many user running on mainframe computers
- UNIX includes many advanced tools like:
send jobs to other computers,
searching for expressions in files,
regular expression,,, etc.
However by running gensys in a virtual machine under VirtualBox.
The problem with different operating systems has now easily been overcome.
Now gensys runs on all machines where VirtualBox is installed.
Most important differences between UNIX and Windows:
- Program EXPLORER.EXE does not exists in UNIX. Please use program "caja" instead.
- The mouse has three buttons:
| Left button || Sets the contents of buffer PRIMARY SELECTION
| Middle button || Paste the contents of buffer PRIMARY SELECTION
| Right button || Pops up the background menu of the program (if the program has a background menu)
- PRIMARY SELECTION is copied to CLIPBOARD by pressing CTRL+Ins.
CLIPBOARD is pasted by pressing SHIFT+Ins.
However, in many programs CTRL+Ins equals CTRL+C, and SHIFT+Ins equals CTRL+V.
But in terminal windows this doesn't work,
because in terminal windows CTRL+C means interrupt and CTRL+V means "Insert next non-digit literally".
Therefore terminal windows are often using the keyboard short-cuts SHIFT+CTRL+C and SHIFT+CTRL+V instead.
- Moving windows are made with "Alt+Mouse Button #1".
Resizing windows are made with "Alt+Mouse Button #3".
- Moving scrollbars work best with "Mouse Button #2".
- Filenames in UNIX can consist of more than one period ".".
A period in a UNIX filenames is just an ordinary character, like "a", "b",,, etc.
- Filenames in UNIX that starts with a period "." are hidden files.
To see them the user can write "ls .*" or "ls -a"
Line terminators in Windows-files consists of both a newline and a carriage_return (CRLF).
UNIX-files have only a newline(NL).
The following two scripts can be used to translate in between the two formats:
|| Translates from DOS to UNIX
|| Translates from UNIX to DOS
Useful UNIX commands:
Command ls lists files in current directory.
Command "opman ls" gives you the full manual of the ls-script.
Without argument command li is exactly the same as ls above.
With argument command li behaves different.
Script li searches for all files in current and all subdirectories matching the search expression given in the argument.
Command cd changes current directory.
Command cd .. changes to parent directory.
Command cd - changes to previous directory.
Command cd is a shell builtin.
In order to read the documentation of
cd write "opman bash".
The egrep utility searches one or more files, line by line, for a pattern.
Example: Lists all occasions of "search text" in all files with extension .txt
egrep 'search text' *.txt
Command "opman egrep" gives you the full manual of the egrep-script.
- regular expression
The "search text" under egrep above is called regular expression.
The following characters have special meanings in a regular expression:
For further information regarding regular expression,
| ^ || The beginning of the line
| $ || The end of the line
| [xy] || Matches both x and y.
| [a-z] || Matches all lower case letter.
| [0-9] || Matches all numbers.
| [^x] || Matches any character except x.
| . || Any character.
| * || Repeats the character in front of the *-sign, the character will be repeated zero or more times.
| \ || Quote the next character. Example: if you are searching for a $-sign you must write \$ in the search expression.
Script sed is a non-interactive text editor.
Sed is useful for doing many changes automatically. Example:
sed "s/old text/new text/" old_file > new_file
Command "opman sed" gives you the full manual of the sed-script.
A tutorial can be found on the Internet at
The tar utility creates, list tables of contents and extract files from an archive file.
Command "opman tar" gives you the full manual of the tar-script.
| Create: || tar -ckz -f archive.tgz <files and directories>
| TOC: || tar -tkz -f archive.tgz
| Extract: || tar -xkz -f archive.tgz
If you want to overwrite existing files you must omit option -k
Other useful commands can be found under Scripts used in the GENSYS package.
Special characters in UNIX:
Environment variables in UNIX:
| Sign || Explanation || Example
| > || Send the output from a command to a file || ls > my_dir.txt
| >> || Appends the output from a command to a file || ls -l >> my_dir.txt
| < || Read input data from a file || cat < my_dir.txt
| <<+ || Read input data direct after the +-sign until the next +-sign || cat <<+
The brown fox jumped
over the lazy dog.
| | || Pipe the output from a command to a second command || ps -ef | grep $USER
| | cc || Pipe the output from a command to CLIPBOARD || ls | cc
| echo `vc` || To see the contents of the CLIPBOARD in a terminal ||
| `vc` || Paste CLIPBOARD to terminal ||
All defined environment variables can be viewed in with the UNIX env-command.
New environment variables can be introduced with the UNIX export-command.
Handeling windows in UNIX:
| Name || Explanation
| $HOME || Name of home directory
| $PATH || The user's search path for commands
| $PWD || Name of current directory
| $USER || User name
| Alt+Btn_1 || Move window
| Alt+Btn_3 || Resize window
| Double click Btn 1 || Rolls up and down the window
| Btn 2 || Lower the window