gcc prog1.c       C compiler.   executable in a.out
gcc -o prog1 prog1.c            executable in prog1

g++ prog1.cpp     C++ compiler

javac Hello.java  Java compiler
java Hello        JVM


Examples:

Standard I/O with command line arguments:
http://sensei.ad.umuc.edu/dwills/cmis160/Programs/rand.cpp

ANSI terminal control:
http://sensei.ad.umuc.edu/dwills/cmit391/ansiscreen.h
http://sensei.ad.umuc.edu/dwills/cmit391/ansiscreenEx2.cpp
http://sensei.ad.umuc.edu/dwills/cmit391/ansiscreenEx3.cpp

Curses library:
http://sensei.ad.umuc.edu/dwills/cmis415/Curses/demo1.cpp
http://sensei.ad.umuc.edu/dwills/cmis415/Curses/rings.cpp
http://sensei.ad.umuc.edu/dwills/cmis415/Curses/mouse.cpp
g++ -lncurses filename.cpp

Xlib:
http://sensei.ad.umuc.edu/dwills/cmis415/X/Xlib_Beginner.c
gcc Xlib_Beginner.c  -L/usr/X11R6/lib -lX11


bash built-in commands:  help
http://sensei.ad.umuc.edu/dwills/cmit391/bash_builtins

type x    to determine if x is  alias, shell reserved word/keyword, shell
          function, shell builtin, or disk file.

which x    search PATH for x
whereis x  

Shell order of evaluation of command line: simplified
   1. keywords (if, case, for, function, while, !, {} ...)
   2. aliases
   3. built-in commands (alias, cd, echo, export, history, jobs, kill,
        read, set, shift, test, trap, umask ...)
   4. functions
   5. PATH search for command


bash shell scripts
http://sensei.ad.umuc.edu/dwills/cmit391/pinglan

/etc/rc.d/init.d/*

Shell functions
--kept in memory (faster than script: No overhead of searching PATH, --opening file from disk, spawning subshell)
--like a built-in command
--variables are global with shell unless typeset to create local variables
--private arguments (alias cannot have args in ksh/bash)
--define in environment file .bashrc, interactively, or in script
typeset -f to list them. or as part of output of set
declare -f
l() {
  ls -l $* | more
}

usage() {
  echo "Usage: et [-a name number | -d name | -p | name]"
  exit $1
}

e() {
  emacs -fg white -font 9x15bold -geometry 90x30+0+0 $* &

}

calc() {
  echo "$*" | bc -l
}
Create interactively:
function myfunname { cmds ;}
tarball: some software is distributed as "tarball", a compressed tar archive of source code files etc.

5 commands to unpack, compile, install:

1. tar -xzf tarballfilename.tar.gz #or .tgz Unpack. creates a subdirectory.
2. cd tarballdirectory
3. ./configure    #Generate customized makefile for the system.
4. make    #Compile using that makefile.
5. make install    #As root, install onto system.