 |
 |
Command line programming
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: UK
Status:
Offline
|
|
Hi,
Now that I have upgraded to OSX, I'd like to be able to use the terminal to do some simple command line programming. No fancy GUI stuff or complex languages. Essentially, these are my criteria.
1. A common, standard language e.g. BASIC, C...
2. Free
3. Uses command line
Thanks for your help in advance,
David
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2001
Location: Sweden
Status:
Offline
|
|
ok
1) install Apples developer tools. You probably got the CD when you bought Mac OS X, if not download it from http://connect.apple.com
2) start Project Builder, choose New Project from the File menu. In the list that shows up, select Standard Tool. As the description says "This project builds a command-line tool written in C."
3) Start coding... you will get a Hello world program to start with, and start building from there. Project Builder will help you with syntax checking and debugging and more, but the end result will be a command line based program that you can run in the terminal.
This page will show you: http://cocoadevcentral.com/articles/000054.php
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
OSX with the developer tools includes everything you need to do command-line programming in C, Objective C, C++, Perl, Python, tcl, and several programmable UNIX shells.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: UK
Status:
Offline
|
|
Thanks for the responses. Does anyone know why the site is so slow to download - its currently averaging 2k/sec - very painful for a 300+Mb download!
Thanks,
David
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2001
Location: Socorro, NM
Status:
Offline
|
|
If you want to work just with the command line (no project builder) you can (once you install dev tools). Just open a terminal window and use gcc to compile C programs. Just type gcc <filename>, and it will compile whatever is in the file to the program a.out, which you can run from the command line. I normally write the program with something like vi; you can use anything that will make a plain text file. If you want to give the output some other name put -o <filename> right after you type gcc. Here is an example:
%> gcc hello.c
%> ~/a.out
Hello World
%> gcc -o hi hello.c
%> ~/hi
Hello World
%>
Also, g++ works like gcc except that it is a c++ compiler.
I hope that this helps.
|
|
-King Rat
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by iMacfan:
Thanks for the responses. Does anyone know why the site is so slow to download - its currently averaging 2k/sec - very painful for a 300+Mb download!
The developer tools installer may already be on your hard drive. If you haven't finished yet, take a look in /Applications/Installers.
But yeah, Apple's developer download site seems to be getting slower as time goes on.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2001
Location: Sweden
Status:
Offline
|
|
Originally posted by iMacfan:
Does anyone know why the site is so slow to download - its currently averaging 2k/sec - very painful for a 300+Mb download!
Probably because all paying ADC members are downloading betas of Panther and XCode like crazy right now.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jul 2002
Status:
Offline
|
|
I've never understood why Apple doesn't use their Akamai connections to do developer distributions. The speed would be so much better that way. You'd think that they'd let their paying customers (and developers to boot) download at reasonable speeds.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Status:
Offline
|
|
Originally posted by iMacfan:
Hi,
Now that I have upgraded to OSX, I'd like to be able to use the terminal to do some simple command line programming. No fancy GUI stuff or complex languages.
# vi MyClass.java
public class MyClass
{
public static final void main(String args[])
{
System.out.println("Hello World");
}
}
# javac MyClass.java
# java MyClass.java
Hello World
1. A common, standard language e.g. BASIC, C...
Java is pretty standard, and very common across all sorts of platforms.
Its built into OSX so no extra charge.
All you need is a simple text editor (vi, emacs), and the command line and you can compile, execute and edit.
And your resulting classes will run on any OS!
|
|
Nobody made a greater mistake than
he who did nothing because he could only
do a little. Edmund Burke
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
C is also compilable/runnable on pretty much everything.
It really depends on what you want to do, and what you prefer...
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|