Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shadowfax

macrumors 603
Original poster
Sep 6, 2002
5,849
0
Houston, TX
say, i am taking a discrete math course for CS here at college, and we had to install a program called hugs98... they have macOS binaries; it's a .pkg that installs the program to /usr/local/bin. i would like to be able to just open the terminal and type ./hugs to run this program, but it doesn't work. i have to cd into /usr/local/bin before ./hugs works. how would i go about making it work from anywhere?
 
sounds like haskell...ewww :eek:

good luck with functional programming :)

add /usr/local/bin to $PATH like this
Code:
setenv PATH /usr/local/bin:$PATH
see if that works

to check if it's in ur path type
Code:
echo $PATH
 
Originally posted by mc68k
sounds like haskell...ewww :eek:

good luck with functional programming :)
cool, that worked. apparently it put in a manual entry for the thing too, but "man hugs" isn't doing anything for me. i dunno if that matters at all--it says it put it in /usr/local/man/man1... any ideas on that?

haskell looks odd; this program is kinda fun to play around with, but i don't see the point at all, so far.
 
Originally posted by shadowfax
cool, that worked. apparently it put in a manual entry for the thing too, but "man hugs" isn't doing anything for me. i dunno if that matters at all--it says it put it in /usr/local/man/man1... any ideas on that?

set MANPATH similar to how you set PATH above
 
Originally posted by zimv20
set MANPATH similar to how you set PATH above
haha, wow, i should have guessed. i just couldn't guess just what the alias for it (MANPATH) would be. that's cool to know.

thanks, you guys are great. that was like 5 minutes, lol.
 
well, the MANPATH thing did work (according to echo $MANPATH), but "man hugs" isn't doing anything for me. i blame the programmers.

although there is a /usr/local/man/man1/hugs.1 file there, says terminal. humbug!

edit: no worries on this of course: who RTFMs these days, anyway? i'll just bitch at my prof.
 
Originally posted by shadowfax
well, the MANPATH thing did work (according to echo $MANPATH), but "man hugs" isn't doing anything for me.

ruh-roh.

execute the following and report back, please:

% echo $MANPATH
% manpath


also, in which file did you set the MANPATH and did you start a new terminal window before 'man hugs'?
 
Originally posted by zimv20
ruh-roh.

execute the following and report back, please:

% echo $MANPATH
% manpath


also, in which file did you set the MANPATH and did you start a new terminal window before 'man hugs'?
[walker1-106:~] mithrandir% echo $MANPATH
/sw/share/man:/usr/share/man:/usr/X11R6/man

so says the man in the terminal. wow, that's weird, i ran it a few min ago and it had the one i put in there... i think...

edit: aha! it all went away when i opened a new terminal session. the $PATH stuff too. how do i make it permanent?
 
I'm actually taking Haskell as a 400 level class. My prof was mentioning that more colleges are offering it as a first year class in England. I guess they're doing it here as well. If you're familiar with a more standard language Haskell has the potential to confuse you. Once you get past the functional stuff (which is actually very nice to use, you can write in two or three lines what might take 20 or 30 in C or Java) and get into I/O you'll be pulling your hair out. Incidentally, my prof says I/O in Haskell is much more well implemented than in previous functional languages. Anyhow, good luck with Haskell.
 
Originally posted by shadowfax

edit: aha! it all went away when i opened a new terminal session. the $PATH stuff too. how do i make it permanent?

stick it in your .login. here's my PATH line(s):

setenv MYSQL_PATH /Developer/MySQL/mysql-3.23.54a-apple-darwin6.1-powerpc
setenv PATH .:/usr/local/bin:${PATH}:${HOME}/bin:${MYSQL_PATH}/bin


i'm not sure of the relationship between the manpath command and the MANPATH environment variable. there may be an extra step to getting the man stuff to work.
 
Originally posted by zimv20
stick it in your .login. here's my PATH line(s):

setenv MYSQL_PATH /Developer/MySQL/mysql-3.23.54a-apple-darwin6.1-powerpc
setenv PATH .:/usr/local/bin:${PATH}:${HOME}/bin:${MYSQL_PATH}/bin


i'm not sure of the relationship between the manpath command and the MANPATH environment variable. there may be an extra step to getting the man stuff to work.
is .login a file that goes in ~/? i don't seem to have one there. should i just make one?
 
You should have a .login file in ~/. Did you use ls -a when looking for it. Any file that begins with a . can only be viewed in a directory listing if you use the -a option.
If you're familiar with command line editing, you might as well follow that route since it's easiest to access a . file from the terminal. Optionally type "open .login" in the terminal to open the file in TextEdit.app. And if you don't have a .login file, there shouldn't be any problem creating one.
 
After adding new man pages, it's a good idea to use the following sequence to rebuild the search index:

Code:
sudo find / -name man -print > manlist.txt

sudo /usr/libexec/makewhatis `paste -d":" -s manlist.txt`

The first command finds all man directories and stores the list in a file. (manlist.txt)

The second command rebuilds the search index using the list from the file.

Note that the single quotes in the second statement are "left" quotes (above the tab key on the keyboard).
 
Originally posted by szark

Code:
sudo find / -name man -print > manlist.txt

sudo /usr/libexec/makewhatis `paste -d":" -s manlist.txt`

neat! i'd add the -type switch to the find command to avoid picking up the actual man command.

sudo find / -name man -type d -print > manlist.txt
 
Originally posted by Kyle?
You should have a .login file in ~/. Did you use ls -a when looking for it. Any file that begins with a . can only be viewed in a directory listing if you use the -a option.
If you're familiar with command line editing, you might as well follow that route since it's easiest to access a . file from the terminal. Optionally type "open .login" in the terminal to open the file in TextEdit.app. And if you don't have a .login file, there shouldn't be any problem creating one.
yeah, i got the whole thing about the .* files with X11 and the whole "make a .xinitrc file" thing. regardless, i have no .login to my name. i didn't make one either, i went to the cshrc.login file and added them there...

szark, i don't really understand what your code is doing on a syntactical basis... where do i put in the "hugs" thing? or do i not need to, will it then go to all the manpath directories i have set and find all the manpages? sorry, i have extensive basic terminal experience, and literally almost no experience with nuances like this :)
 
Originally posted by shadowfax
where do i put in the "hugs" thing? or do i not need to, will it then go to all the manpath directories i have set and find all the manpages?

the find command will pick up all the installed man pages.

btw, if you've ever done an archive install, that find command will pick up the man pages in there. not sure what'll happen then, when you issue the man command. two man pages to show you?

if you do, then add this command before running the makewhatis:

% grep -v 'Previous Systems' manlist.txt > manlist2.txt


then use manlist2.txt in the makewhatis command, of course.
 
output files? we don't need no stinkin' output files!

nuts to all that. let's make one big command w/ pipes! make it easier on yourself and login as root, then:

# find / -name man -type d -print | grep -v 'Previous Systems' | paste -d":" -s - | makewhatis
 
Re: output files? we don't need no stinkin' output files!

aaaaah! quick! someone stop them before i switch to a humanities major!
 
Re: Re: output files? we don't need no stinkin' output files!

Originally posted by shadowfax
aaaaah! quick! someone stop them before i switch to a humanities major!

no! PIPE! YOU MUST PIPE!!!!
 
Originally posted by zimv20
neat! i'd add the -type switch to the find command to avoid picking up the actual man command.

sudo find / -name man -type d -print > manlist.txt

Damn! Knew I forgot something... :)

Code:
mv ~/CS/major ~/Humanities/major

:D
 
Originally posted by zimv20
Code:
cp ~/CS/major ~/Humanities/major

ooh. now my brain hurts.
wait, so now i am double majoring? whaaa?

excuse me while i take my life in an elevator shaft.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.