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
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: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.