Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Changing 'user.cs_path' from 'sysctl'

Changing 'user.cs_path' from 'sysctl'
Thread Tools
Senior User
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Jul 2, 2001, 10:53 PM
 
hello,
i would like to know why the 'user.cs_path' variable isn't changable? The reason i want to change it is because the 'whereis'
command check user.cs_path to search for stuff. but i would ilke to add other locations to the 'whereis' search path,
which means i'd have to be able to edit 'user.cs_path', but as you can see if you check 'man sysctl', user.cs_path is not
changeable. so how can i get around this little problem?
Death To Extremists!
     
Forum Regular
Join Date: May 2001
Status: Offline
Reply With Quote
Jul 2, 2001, 11:52 PM
 
Isn't 'locate' the preferred way of doing this?

'man whereis':
HISTORY
The whereis command appeared in 3.0BSD.

'man locate':
HISTORY
The locate command appears in 4.4BSD.
     
Senior User
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Jul 3, 2001, 01:04 AM
 
i'm not familiar with locate, but I did find the gutz to divulge into kriptic *NIX man files and read about locate. unfortunately, i don't understand the man file on locate. what is it referring to as a pattern? so can you (in common english), tell me the syntax to use the locate command?


what i want is a utility that i can do '<util> halt', and it will report '/sbin/halt'. to do this, you can use either the 'whereis' command or 'which'. the problem i'm having is that i want to expand the search capability of either whereis or which. anyone know how? what shell variables do i have to edit since 'which' is a shell built-in command?

[ 07-03-2001: Message edited by: mactropolis ]
Death To Extremists!
     
Forum Regular
Join Date: May 2001
Status: Offline
Reply With Quote
Jul 3, 2001, 01:08 AM
 
Ummm... 'locate <string>'

man locate gives:

LOCATE(1) System Reference Manual LOCATE(1)

NAME
locate - find files

SYNOPSIS
locate pattern

DESCRIPTION
locate searches a database for all pathnames which match the specified
pattern. The database is recomputed periodically, and contains the path-names of all files which are publicly accessible.

Shell globbing and quoting characters (``*'', ``?'', ``\'', ``['' and
``]'') may be used in pattern, although they will have to be escaped from the shell. Preceding any character with a backslash (``\'') eliminates any special meaning which it may have. The matching differs in that no characters must be matched explicitly, including slashes (``/'').

As a special case, a pattern containing no globbing characters (``foo'') is matched as though it were ``*foo*''.

FILES
/var/db/locate.database Database
/usr/libexec/locate.updatedb Script to update database.

SEE ALSO
find(1), fnmatch(3), weekly.conf(5)

Woods, James A., "Finding Files Fast", ;login, 8:1, pp. 8-10, 1983.

HISTORY
The locate command appears in 4.4BSD.

BSD Experimental June 6, 1993

Which is about the simplest man page I've ever seen.

On second look, maybe this *isn't* what you need, since it gives you every file on the system whose name contains the pattern, and not just apps.
     
Senior User
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jul 3, 2001, 08:58 AM
 
The three methods:

1. 'which <prog>' - given the current value of $PATH, walk each path
element and report back which is the first one to match. This is the one
which would be executed.

2. 'whereis <prog>' - given a predefined set of subdirectories, walk each one and report back ALL of the matches.

3. 'locate <pattern>' - given a binary database rooted at some point in
the filesystem (/ usually), essentially 'egrep' the database looking for a pattern match. The database is usually re-created via cron and can take a while to generate.

You could also get GNU fileutils and get a more reasonable version of
whereis (I think it's in fileutils).
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:44 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2