Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 1998 12:59:53 -0700 (PDT)
From:      David Wolfskill <dhw@whistle.com>
To:        freebsd-newbies@FreeBSD.ORG
Subject:   Re: Running X
Message-ID:  <199804171959.MAA12044@pau-amma.whistle.com>

next in thread | raw e-mail | index | archive | help
>Date: Fri, 17 Apr 1998 14:28:27 -0500 (CDT)
>From: "Matthew D. Fuller" <fullermd@futuresouth.com>

>/usr/X11R6/bin probably isn't in your path....

Another approach to determining whether or not a given program is likely
to be found if you try to execute it (and if so, where it is), is to use
the csh (and tcsh -- maybe others) "shell built-in" command "which":

pau-amma[2]% which startx xinit X which
/usr/X11R6/bin/startx
/usr/X11R6/bin/xinit
/usr/X11R6/bin/X
which: shell built-in command.
pau-amma[3]% 

For folks of sufficient;y twisted mindsets, it's also possible to use
the output of "which" as the input of something else:

pau-amma[3]% file `!!`
file `which startx xinit X which`
/usr/X11R6/bin/startx: Bourne shell script text
/usr/X11R6/bin/xinit:  FreeBSD/i386 compact demand paged dynamically linked executable
/usr/X11R6/bin/X:      symbolic link to /usr/X11R6/bin/XF86_S3V
which::                can't stat `which:' (No such file or directory).
shell:                 can't stat `shell' (No such file or directory).
built-in:              can't stat `built-in' (No such file or
directory).
command.:              can't stat `command.' (No such file or
directory).
pau-amma[4]% 

(Sometimes, it's useful to know when a given program's whimpers &
complaints are safe to ignore....)

Now that you know that startx is a script, "less `which startx`" will
let you take a look at it (assuming, of course, that it's in your path,
and that "less" is also in your path -- you could use "more" rather than
"less"... but we don't need to go into that right now...).

For sh (& similar shells, I believe), there's a command that has similar
functionality, called "type".  (And if you're running one of those
shells, there's a "which" Perl script in /usr/bin, though this seems to
be a FreeBSDism, so don't rely on it if you happen to be using some
other platform.)

Hope that helps folks figure things out a little better,
david
-- 
David Wolfskill		dhw@whistle.com	(650) 577-7158	pager: (650) 401-0168

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804171959.MAA12044>