1
I am currently writing some convenience methods for my terminal in my bash_profile and am sure if what I am writing is "the best way". I figure a good way to verify whether what I'm doing is right or not would be to find some source code of more established programs and see how they do it.
My question then is, where can I find this code on my Mac? An example is, with Macports installed, where is the source code that opens the port interactive console when I type nothing but "port" in my shell?
(I added Linux in the title even though I am on a Mac because I assume the answer would be the same for both)
Edit: The answer I am looking for is in terms of which directory relative to the programs will I find their unix scripts.
I know they are in plain text, but where? I'm not worried about learning the syntax, but rather would like to be able to read the source so I can get a good idea of how the scripts are written and compare them to how they run. That Advanced Bash-Scripting Guide seems very useful though - thanks for that. – AndrewKS – 2011-01-06T19:21:44.577
If they are installed and in path, you can just type 'which scriptname', if they aren't executable/in path try 'locate scriptname'. – OneOfOne – 2011-01-06T20:47:38.947