bah, a command line problem

Discussion in 'Mac Apps and Mac App Store' started by shadowfax, Aug 27, 2003.

  1. shadowfax macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #1
    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?
     
  2. mc68k macrumors 68000

    mc68k

    Joined:
    Apr 16, 2002
    #2
    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
     
  3. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #3
    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.
     
  4. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #4
    set MANPATH similar to how you set PATH above
     
  5. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #5
    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.
     
  6. mc68k macrumors 68000

    mc68k

    Joined:
    Apr 16, 2002
  7. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #7
    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.
     
  8. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #8
    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'?
     
  9. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #9
    [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?
     
  10. kylos macrumors 6502a

    kylos

    Joined:
    Nov 8, 2002
    Location:
    MI
    #10
    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.
     
  11. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #11
    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.
     
  12. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #12
    is .login a file that goes in ~/? i don't seem to have one there. should i just make one?
     
  13. kylos macrumors 6502a

    kylos

    Joined:
    Nov 8, 2002
    Location:
    MI
    #13
    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.
     
  14. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #14
    yes and yes.
     
  15. szark macrumors 68030

    szark

    Joined:
    May 14, 2002
    Location:
    Arid-Zone-A
    #15
    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).
     
  16. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #16
    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
     
  17. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #17
    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 :)
     
  18. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #18
    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.
     
  19. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #19
    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
     
  20. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #20
    Re: output files? we don't need no stinkin' output files!

    aaaaah! quick! someone stop them before i switch to a humanities major!
     
  21. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #21
    Re: Re: output files? we don't need no stinkin' output files!

    no! PIPE! YOU MUST PIPE!!!!
     
  22. szark macrumors 68030

    szark

    Joined:
    May 14, 2002
    Location:
    Arid-Zone-A
    #22
    Damn! Knew I forgot something... :)

    Code:
    mv ~/CS/major ~/Humanities/major
    :D
     
  23. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #23
    Code:
    cp ~/CS/major ~/Humanities/major
    ooh. now my brain hurts.
     
  24. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #24
    wait, so now i am double majoring? whaaa?

    excuse me while i take my life in an elevator shaft.
     
  25. kylos macrumors 6502a

    kylos

    Joined:
    Nov 8, 2002
    Location:
    MI
    #25
    Code:
     rm -r /'elevator shaft'/shadowfax
    There. That should do it for ya.:)
     

Share This Page