Modernized shell scripts
This tries to modernize the shell scripts. It also replace many c preprocessor ifdef with runtime detection(uname). There is now only 1 ifdef remaining and most defines set shell variables at the start of the script. If the mcookie logic can be replaced, the cprepossor can be dropped completely and replaced by shell variables.
the backtick and x-prefix trick has with replaced with modern conterparts. Qouting has ben added in some places. Note testing was done on linux so probably needs confirmation by Xquartz and Solaris