CS253 Final Review Guide

	One page of multiple choice.
	Rest is short answer, and the answer might be a program
	Need to know symbols BASH uses.  *, [ ], ., &, $ (for variables), ` (backticks), " and ', > >> 2> 2>> <, { }
	Remember that a lot of the symbols bash uses have different meanings to grep
	Regular expressions for grep and sed.  ., [ ], ^, $, *, { }
	10 pages of notes are allowed, 8.5 by 11 both sides
	C will also be on the test.
	
	C topics include:
		argv and argc
		Variable types, such as char*, or arrays, etc
		Scope, remember how this works, such local variables in functions
		Calling system functions (The main 253 topic)
		File descriptors (Another big one, used a lot in cs430)
		System functions you already know, such as:
			fork, pipe, exec, file manipulation (open, read, write, lseek, etc), sigaction, getpid, kill, exit, gethostname, project 1 functions, dup2, anything else we used in a class example
		pointers, such as in argv or char*, the way we use them to call system functions
		basic loops, if statements, etc (same stuff as in C++)
		Heap memory functions (malloc, free, realloc)
		Daemons
	
There are no questions which are purely from the book. A lot of the questions require you to know how a Linux system functions in general. Creativity and reasoning will go a long way toward a good score.
Commands which appeared somewhere on the test the time before last time: Command-line pipes are mentioned in multiple questions, so be familiar with how to use these.
Some question ideas:

(and exerpt from, or the whole, manual page for getcwd)
Use getcwd to store the current directory in an array allocated with malloc.  Use a size that seems big enough for most directories but not excessive.

Suppose you have the following code:
int x = sin(0);
printf("%d\n", x);
What does it print?
(Note:  I don't like this one for 253, could be good for 211)

What does the following program print?
#include
#include
int main(){
	printf("hi\n");
	exec("a.out", "a.out");
}
Assume it's compiled like this:
gcc the_program.c