: create commands in cmd5
echo 
echo cmd5
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 ../cmd5
if x$1 = x goto all
goto $1
: all
= a all
: sa
echo /usr/bin/sa
cc -s -O sa.c
mv -f a.out /usr/bin/sa
chmod 755 /usr/bin/sa
chown bin /usr/bin/sa
if x$a = x exit
: sed
echo /bin/sed
cc -O -s sed0.c sed1.c
mv -f a.out /bin/sed
rm sed0.o sed1.o
chmod 755 /bin/sed
chown bin /bin/sed
if x$a = x exit
: sh
echo /bin/sh
cc -s -O -n sh.c
mv -f /bin/sh /bin/osh
echo "/bin/osh created, remove after next boot."
mv -f a.out /bin/sh
chmod 755 /bin/sh
chown bin /bin/sh
if x$a = x exit
: size
echo /bin/size
cc -s -O size.c
mv -f a.out /bin/size
chmod 755 /bin/size
chown bin /bin/size
if x$a = x exit
: sleep
echo /usr/bin/sleep
cc -s -O sleep.c
mv -f a.out /usr/bin/sleep
chmod 755 /usr/bin/sleep
chown bin /usr/bin/sleep
if x$a = x exit
: sort
echo /bin/sort
cc -s -O sort.c
mv -f a.out /bin/sort
chmod 755 /bin/sort
chown bin /bin/sort
if x$a = x exit
: split
echo /usr/bin/split
cc -s -O split.c
mv -f a.out /usr/bin/split
chmod 755 /usr/bin/split
chown bin /usr/bin/split
if x$a = x exit
: strip
echo /bin/strip
as strip.s
strip a.out
mv -f a.out /bin/strip
chmod 755 /bin/strip
chown bin /bin/strip
if x$a = x exit
: stty
echo /bin/stty
cc -s -O stty.c
mv -f a.out /bin/stty
chmod 755 /bin/stty
chown bin /bin/stty
if x$a = x exit
: su
echo /bin/su
cc -s -O su.c
mv -f a.out /bin/su
chmod 4755 /bin/su
chown root /bin/su
if x$a = x exit
: sum
echo /bin/sum
as sum.s
strip a.out
mv -f a.out /bin/sum
chmod 755 /bin/sum
chown bin /bin/sum
if x$a = x exit
: sync
echo /bin/sync
cc -s -O sync.c
mv -f a.out /bin/sync
chmod 755 /bin/sync
chown bin /bin/sync
