Jump to content
13 posts in this topic

Recommended Posts

The terminal is not a programming environment per-se but there is something called shell script programming.

I think you should take a look at some programming books for beginners in OSX. I found this one that seems appropriate:

http://www.amazon.com/Beginning-Mac-OS-X-P...g/dp/0764573993

(Maybe you can find a PDF of this book on a torrent site)

 

Cheers,

 

hecker

Search for bash scripting. Bash is the default shell (look at the title of the terminal window)

 

If you save a file with the .command extention if will open in terminal on doubleclick.

The first line of the script should be #!/bin/bash

Perl is also an option, its already installed on OSX and you can also use it for cgi scripts for websites.

Then use #!/usr/bin/perl (check with: whereis perl)

Make sure the script is executable (chmod +x filename ) and use unix linefeeds. (get BBedit demo)

 

#!/bin/bash

echo "Hello World!"

 

or

#!/usr/bin/perl

print "Hello World!";

did you mean creating programs that will run in the terminal? just any normal UNIX C will work in OSX. just pickup and C book or online C tutorials and you'll be good to go.

 

if your going to learn C go for "C for dummies" that was the best out of the C books i went through

  • 3 months later...

shell scripting: google: "unix shell scripting" or "bash shell scripting"

 

for writing actual programs:

 

install XCode (it is on the Mac OS X install CD, or the apple website), and use that.

 

to make a C++ or C program, go to file -> new project -> C++ command line utility (this should build C programs too, because C++ includes all C commands, right?)

 

to learn C++: I wouldn't pay for a book. there are so many online tutorials that it is a joke. http://www.cplusplus.com/doc/tutorial/ is what i used, it was very good. there are also many others.

 

and/or (and this is best after learning C++) you could learn to make bona-fide mac os x applications in cocoa, which is based off C with some small variations. both of these sites helped a lot: http://www.oreilly.com/pub/ct/37 <- start from bottom, work your way up. it teaches you everything pretty much. it is awesome. http://cocoadevcentral.com/

 

there are more resources in teh programming forum. hope this helps. its a lot of fun. also openGL is fun too (pretty 3d shapes...)

×
×
  • Create New...