: create commands in cmd2
echo 
echo cmd2
echo must run as super user!!!

if x$1 = xfpp goto fpp
if x$1 = xnofpp goto nofpp
echo nofpp assumed
goto noshift
: nofpp
if x$1 = x goto noshift
shift
: noshift
= f -f
goto aon
: fpp
if x$1 = x goto aon
shift
: aon
chdir ../cmd2
if x$1 = x goto all
goto $1
: all
= a all
: echo
echo /bin/echo
cc -s -O echo.c
mv -f a.out /bin/echo
chmod 755 /bin/echo
chown bin /bin/echo
if x$a = x exit
: ed
echo /bin/ed
cc -s -n -O ed.c
mv -f a.out /bin/ed
chmod 755 /bin/ed
chown bin /bin/ed
if x$a = x exit
: exit
echo /bin/exit
cc -s -O exit.c
mv -f a.out /bin/exit
chmod 755 /bin/exit
chown bin /bin/exit
if x$a = x exit
: errdemon
echo /etc/errdemon
cc -O -s errdemon.c
mv -f a.out /etc/errdemon
chmod 755 /etc/errdemon
chown bin /etc/errdemon
if x$a = x exit
: errpt
echo /usr/bin/errpt
cc -O -s errpt.c
mv -f a.out /usr/bin/errpt
chmod 755 /usr/bin/errpt
chown bin /usr/bin/errpt
if x$a = x exit
: factor
echo /usr/bin/factor
as factor.s
ld -s a.out -l
mv -f a.out /usr/bin/factor
chmod 755 /usr/bin/factor
chown bin /usr/bin/factor
if x$a = x exit
: fc
echo /bin/fc
cc -O -s -n fc.c
mv -f a.out /bin/fc
chmod 755 /bin/fc
chown bin /bin/fc
if x$a = x exit
: file
echo /usr/bin/file
cc -s -O file.c
mv -f a.out /usr/bin/file
chmod 755 /usr/bin/file
chown bin /usr/bin/file
if x$a = x exit
: find
echo /bin/find
cc -s -O find.c
mv -f a.out /bin/find
chmod 755 /bin/find
chown bin /bin/find
if x$a = x exit
: getty
echo /etc/getty
cc -s -O -n getty.c
mv -f a.out /etc/getty
chmod 755 /etc/getty
chown bin /etc/getty
if x$a = x exit
: glob
echo /etc/glob
cc -s -O glob.c
mv -f a.out /etc/glob
chmod 755 /etc/glob
chown bin /etc/glob
if x$a = x exit
: goto
echo /bin/goto
cc -s -O goto.c
mv -f a.out /bin/goto
chmod 755 /bin/goto
chown bin /bin/goto
if x$a = x exit
: grep
echo /usr/bin/grep
cc -s -O grep.c
mv -f a.out /usr/bin/grep
chmod 755 /usr/bin/grep
chown bin /usr/bin/grep
if x$a = x exit
: gsi
echo /usr/bin/gsi
cc -s -O gsi.c
mv -f a.out /usr/bin/gsi
chmod 755 /usr/bin/gsi
chown bin /usr/bin/gsi
if x$a = x exit
: hyphen
echo /usr/bin/hypyen
cc -s -O hyphen.c
mv -f a.out /usr/bin/hyphen
chmod 755 /usr/bin/hyphen
chown bin /usr/bin/hyphen
if x$a = x exit
: icheck
echo /bin/icheck
as ichecks.s
mv a.out ichk.o
cc -s -O icheck.c ichk.o
rm ichk.o
mv -f a.out /bin/icheck
chmod 755 /bin/icheck
chown bin /bin/icheck
if x$a = x exit
: if
echo /bin/if
cc -s -O if.c
mv -f a.out /bin/if
chmod 755 /bin/if
chown bin /bin/if
if x$a = x exit
: init
echo /etc/init
cc -s -O -n init.c
mv -f /etc/init /etc/oinit
echo "/etc/oinit created, remove after next boot."
mv -f a.out /etc/init
chmod 755 /etc/init
chown bin /etc/init
if x$a = x exit
: ino
echo /bin/ino
cc -s -O ino.c
mv -f a.out /bin/ino
chmod 755 /bin/ino
chown bin /bin/ino
if x$a = x exit
: iostat
echo /usr/bin/iostat
cc -O -s iostat.c
mv -f a.out /usr/bin/iostat
chmod 755 /usr/bin/iostat
chown bin /usr/bin/iostat
if x$a = x exit
: kill
echo /bin/kill
cc -O -s -n kill.c
mv -f a.out /bin/kill
chdir /etc
chmod 755 getty glob init
chmod 755 /bin/kill
chown bin /bin/kill
