Subject: Re: Struggling with RiscBSD: Update
To: Paul Whiting <paul@whtng.demon.co.uk>
From: Robert Black <r.black@ic.ac.uk>
List: port-arm32
Date: 09/16/1997 17:19:32
On Sep 15,  6:02pm, Paul Whiting wrote:
> Subject: Struggling with RiscBSD: Update

[snip]

> echo $path produced
>
> /sbin /bin /usr/sbin /usr/bin
>
> typing:
>
> set path="$path /usr/X11R6.1/bin"
> and then the echo gave
>
> /sbin /bin /usr/sbin /usr/bin /usr/X11R6.1/bin
>
> whereafter, NO commands worked (ls, stty, you name it - least of all xinit).

Okay, the confusion here is that there are several types of shell (command line
interpreter) with slightly different syntaxes. The syntaxes for setting the
path are:

For Bourne-shell compatible shells (sh, bash, jsh et al):

	PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6.1/bin"
	export PATH

or
	PATH="$PATH:/usr/X11R6.1/bin"
	export PATH

For csh compatible shells (csh, tcsh et al):

	set path=(/sbin /bin /usr/sbin /usr/bin /usr/X11R6.1/bin)

or
	set path=($path /usr/X11R6.1/bin)

The reason that you were having trouble was that putting quotes around
something with spaces in turns it into a single 'word'. For example:

	cat foo bar

prints out the contents of file 'foo' followed by the contents of file 'bar'.

	cat "foo bar"

prints out the contents of file 'foo bar' (note the space in the filename).

The syntax of set is

	set var=word

or

	set var=(wordlist)

where wordlist is a space separated list of words. Setting the path in a
Bourne-compatible-shell uses a single word so translating directly from one
syntax to the other can be dangerous.

The type of shell you use is set in your user entry in the passwd file.

Cheers

Rob