Customizing the Shell Environment

When gsh, the implementation of the GNO Shell, is executed, it reads in and processes the gshrc file. This file contains start-up instructions for the shell, which can be used to customize the operation of the shell and other aspects of the system. It is created by the GNO Installer during the installation process.

The following is a sample gshrc file (line numbers have been added for convenience):

1	###
2	#
3	# GNO 2.0 gshrc file
4	#
5	###
6	#
7	# Initialize our environment
8	#
9	set path=":hard:gno:bin :hard:gno:usr:bin"
10	set prompt="[%h] %S%t%s %C> "
11	set home=":hard:gno:user:root"
12	set term=gnocon
13	export path prompt home term
14	setenv history=100 savehist=25
15	###
16	#
17	#Set up standard prefixes for utilities.
18	#
19	###
20	prefix 2 :software:orca:libraries
21	prefix 3 :software:orca
22	prefix 4 :software:orca:shell
23	prefix 5 :software:orca:languages
24	prefix 6 :software:orca:utilities
25	prefix 7 :tmp
26	###
27	#
28	# Set up prefixes for Orca2.0(tm)'s benefit
29	#
30	###
31	prefix 13 :software:orca:libraries
32	prefix 14 :software:orca
33	prefix 15 :software:orca:shell
34	prefix 16 :software:orca:languages
35	prefix 17 :software:orca:utilities
36	alias ls 'ls -CF'
37	alias dir 'ls -al'
38	alias cp 'cp -i'
39	alias rm 'cp -p rm'
40	alias mv 'cp -p mv'
41	setenv usrman='/usr/man'
42	set fignore='.a .root .sym'
43	alias zcat 'compress -cd'
44	setenv pager=less
45	setenv less=-e
46	set nonewline=1
47	#
48	# Move to home directory
49	#
50	cd

When you install GNO/ME, the GNO installer knows where to find the GNO utilities and any ORCA utilities you may have. Unfortunately it does not know where all the other utilities and applications that you may wish to use are located. It is therefore necessary to edit the setup file in order to tell the GNO shell where these programs are on your hard disk.

The setup file, gshrc, is located in the /usr directory of the path where you installed GNO/ME. You can use any text editor from the desktop to edit the gshrc file, or if you are already familiar with the editor vi you can use this utility after launching the GNO kernel.

Line 9 is the statement that we are concerned with. Hard represents the name of your particular hard drive volume where you have installed GNO/ME.

9	set path=":hard:gno:bin :hard:gno:usr:bin"

You will see that spaces have been inserted between pathnames. The space is the pathname separator and the colon has been used as the path delimiter for this specific variable, PATH. As an exercise, add your system directory to this statement. Line 9 should now look like this:

9	set path=":hard:gno:bin:hard:gno:usr:bin :hard:system"

What you have just done allows the GNO shell to find the Finder application. Now go ahead and add any pathnames that hold utilities or applications that you will use frequently from GNO/ME. It should also be noted that it is possible to have more than one pathname containing EXE, SYS16, or EXEC files; this is impossible under ORCA. The PATH variable is discussed thoroughly in the Chapter called Shell Variables.

For now, the remaining lines of the gshrc file do not need editing. As you gain an understanding of the system you may wish to make further changes to the gshrc file. Make sure you save the file before you exit the editor.

It is possible to modify these instructions while the GNO shell is active, but any changes will be lost upon exiting gsh. If you wish the changes to remain effective for the next session you must add them to the gshrc file.

By customizing the gshrc file it is possible to make the GNO environment more like UNIX, the ORCA environment, or something completly different. Customization of the GNO environment leads to greater user productivity.