image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old February 19th, 2002, 03:34 PM
unlearnthetruth's Avatar
Recycle Me!
 
Join Date: Dec 2001
Location: Long Island, NY <or> Villanova University (depending on time of year)
Posts: 567
Thanks: 0
Thanked 0 Times in 0 Posts
unlearnthetruth is on a distinguished road
Question Command Line?

lets say i download a command line app..... how would i umm...... go about.... well.... running it? I know nothing about the terminal, except "banner" and how to get to the emacs games I'd like to learn how to do useful stuff, but i don't even know where to look, and the man pages in terminal aren't very helpful. So can anyone either fill me in on the very basics, or send me somewhere that will?

Thanks!
__________________

Sawtooth 500mhz | 512 RAM | 120 GB HD | 60 GB HD | QPS Que! Fire 8x | Zip 100 | 9.2.2 (rarely) | 10.2.2 | Sony Cybershot P30 | Epson Sylus Photo820| ATI Radeon 8500 | StudioDisplay 17 CRT | Kensington StudioMouse

~defective.media~
Reply With Quote
  #2  
Old February 19th, 2002, 04:24 PM
kilowatt's Avatar
mach-o mach-o man
 
Join Date: Mar 2001
Location: irc.lfnet.net #kilonet
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
kilowatt is on a distinguished road
well, although this will highly depend on the application, here are some general rules:
First, download the program (duh). Try and download it so that stuffit doesn't decompress it - stuffit sometimes messes up filenames and stuff.
So, after its downloaded, get into the terminal.
I'll use '%' as the shell prompt caus its alot easier to type than '[localhost: ~] unlearn%' or whatever your prompt is.
%cd ~/Downloads
(this changes directory to a folder in /users/MyUsername/Downloads - change it to wherever you downloaded the app to).
%gunzip myapp.tar.gz
%tar -xvf myapp.tar
(yes there is a way to do that all in one step, but I honestly don't know it.. maybe its tar -xzvf... not sure).

next, cd into the created directory:
%cd myapp
now, take a look arround:
%ls -F
The -F makes your ls binary mark the files as either @ (simbolic link), *(executable) or / (directory). I find it very usefull.

At this point you have to figure out if the program is 1) precompiled binary, or 2) sourcecode. Its probably 2. If you arn't sure, just look for the presence of a file called 'configure' or 'makefile.in'. (Its also posable that your download is a perl file or something like that - thats another story...)

If you really want to get into it, type:
%file *
this will attempt to identify each file as to what it is (such as lsb-x86 binary, mpeg-2 stream, bash shell script, ascii data, etc).

Now I recomend reading all the documentation it came with, except for maybe the release logs and stuff like that.

%cat INSTALL | more
The '|' is called a 'pipe' and directs the output of the first command (cat INSTALL) into the input of the second command (more) (the pipe is the key direectly above the return key on most apple keyboards). This is needed because its quite likely that without the 'more' command, the text will 'outscroll' the terminal and you'll have to either scroll up or scroll up and increase your scroll buffer.
Once you have typed that, press return for the next line, space for the next page, and b for the previous page. / is the command to search - just type /compile to search for the word 'compile' in the file. Press q to quit the more command.

you'll probably also want to read the readme
%cat README | more

ok, so now you're read them. Here's what they will probably tell you to do:
%./configure
(the ./ makes your shell look within the current directory (called .) for the file 'configure').
configure, or sometimes Configure will create a file to tell your compiler how to compile and install the program.
You may get errors at this point (which is where macosx.com comes in handy )
next, its probably time for:
%make
'make' reads the Makefile, and directs your c compiler as to how to compile the program, and where to find the needed libraries and stuff.
This may take quite a while, depending on the complexity of the application you are compiling.
next, do this:
%sudo make install
Now enter YOUR password. If you are not logged in as an Admin account, sudo will fail - you gotta be in the 'wheel' (aka admin) group to sudo.
sudo lets the make program install with root privs. This is needed caus some of the directories on macosx are root-only, and can't be written to otherwise.

At this point, the application is uncompressed, configured, compiled, and installed. You can now remove the directory you downloaded it in, although I wouldn't untill I verify that it works.

most likely, the program will be installed into your path ($PATH that is). This means the shell will know where it is, and you can just type the name of the program from any directory and it will run.

Glad you had the guts to ask this question. If there is anything else I can help you with, please don't hesitate to ask!
__________________
irc.lfnet.net #kilonet -+=join in=+-
Quote:
...the belief that the rights of man come not from the generosity of the state but the hand of God...
PEBKAC - Problem Exists Between Keyboard And Chair. --who said it first?
Audio Engineer - ProTools and Logic Pro Certified.
FCC Licensed RF Technician
Reply With Quote
  #3  
Old February 19th, 2002, 05:05 PM
zots's Avatar
Re-member
 
Join Date: Jun 2001
Location: Ft Lauderdale
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
zots is on a distinguished road
tgz

i found a version of bitchx in .tar.gz format. after i did gunzip and tar it made 3 files: BitchX, scr-bx, and wserv. there is no directorie, install file, or readme. i tried ./configure, make, and make install on each file but i got nothin. thanks for help.
__________________
Plaisir d'amour ne dure qu'un moment,
Chagrin d'amour dure toute la vie.

Last edited by zots; February 19th, 2002 at 05:29 PM.
Reply With Quote
  #4  
Old February 19th, 2002, 05:30 PM
kilowatt's Avatar
mach-o mach-o man
 
Join Date: Mar 2001
Location: irc.lfnet.net #kilonet
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
kilowatt is on a distinguished road
as far as I know, .tgz means .tar.gz. Just rename it if it doesn't work. Seriously, some of these unix apps are dumb and look at the file name and say "Uhh we don't service those here"

mv file.tgz file.tar.gz
then do the regular gunzip and tar routine.

btw, if you get bitchx working, let me know - I tried it for two days and just could not get it to compile. Something about abot.c or something.. wouldn't compile.
Reply With Quote
  #5  
Old February 20th, 2002, 02:33 AM
hazmat's Avatar
Rusher of Din
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 1,803
Thanks: 0
Thanked 0 Times in 0 Posts
hazmat is on a distinguished road
Yes, tgz is the same thing as .tar.gz. In this version of tar (and GNU tar) the 'z' option will use gunzip, so you can do it in one step, 'tar zxvf'.

Not sure what the problem with BitchX was, but maybe you got a weird or bad distribution?
Reply With Quote
Reply

Thread Tools

Posting 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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 08:53 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.