: create commands in cmd3
echo 
echo cmd3
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 ../cmd3
if x$1 = x goto all
goto $1
: all
= a all
: line
echo /bin/line
cc -s -O line.c
mv -f a.out /bin/line
chmod 755 /bin/line
chown bin /bin/line
if x$a = x exit
: ln
echo /bin/ln
cc -s -O ln.c
mv -f a.out /bin/ln
chmod 755 /bin/ln
chown bin /bin/ln
if x$a = x exit
: login
echo /bin/login
cc -s -O login.c
mv -f a.out /bin/login
chmod 4755 /bin/login
chown root /bin/login
if x$a = x exit
: lpd
echo /etc/lpd
as lpd.s
ld -s a.out -l
mv -f a.out /etc/lpd
chmod 4755 /etc/lpd
chown root /etc/lpd
if x$a = x exit
: lpr
echo /bin/lpr
cc -s -O lpr.c
mv -f a.out /bin/lpr
chmod 755 /bin/lpr
chown bin /bin/lpr
if x$a = x exit
: ls
echo /bin/ls
cc -s -O ls.c
mv -f a.out /bin/ls
chmod 755 /bin/ls
chown bin /bin/ls
if x$a = x exit
: mail
echo /usr/bin/mail
cc -s -O mail.c
mv -f a.out /usr/bin/mail
chmod 755 /usr/bin/mail
chown bin /usr/bin/mail
if x$a = x exit
: mesg
echo /usr/bin/mesg
cc -s -O mesg.c
mv -f a.out /usr/bin/mesg
chmod 755 /usr/bin/mesg
chown bin /usr/bin/mesg
if x$a = x exit
: mkdir
echo /bin/mkdir
cc -O -s mkdir.c
mv -f a.out /bin/mkdir
chmod 4755 /bin/mkdir
chown root /bin/mkdir
if x$a = x exit
: mkfs
echo /etc/mkfs
cc -s -O mkfs.c
mv -f a.out /etc/mkfs
chmod 755 /etc/mkfs
chown bin /etc/mkfs
if x$a = x exit
: mknod
echo /etc/mknod
cc -s -O mknod.c
mv -f a.out /etc/mknod
chmod 755 /etc/mknod
chown bin /etc/mknod
if x$a = x exit
: mkpt
echo /etc/mkpt
cc -s -O mkpt.c
mv -f a.out /etc/mkpt
chmod 755 /etc/mkpt
chown bin /etc/mkpt
if x$a = x exit
: mount
echo /etc/mount
cc -s -O mount.c
mv -f a.out /etc/mount
chmod 755 /etc/mount
chown bin /etc/mount
if x$a = x exit
: mtm
echo /usr/bin/mtm
cc -s -O mtm.c
mv -f a.out /usr/bin/mtm
chmod 755 /usr/bin/mtm
chown bin /usr/bin/mtm
if x$a = x exit
: mv
echo /bin/mv
cc -s -O mv.c
cp a.out /bin/mv
rm -f a.out
chmod 4755 /bin/mv
chown root /bin/mv
if x$a = x exit
: mvall
echo /usr/bin/mvall
cc -s -O mvall.c
mv -f a.out /usr/bin/mvall
chmod 755 /usr/bin/mvall
chown bin /usr/bin/mvall
if x$a = x exit
: ncheck
echo /bin/ncheck
cc -s -O ncheck.c
mv -f a.out /bin/ncheck
chmod 755 /bin/ncheck
chown bin /bin/ncheck
if x$a = x exit
: nice
echo /usr/bin/nice
cc -s -O nice.c
mv -f a.out /usr/bin/nice
chmod 755 /usr/bin/nice
chown bin /usr/bin/nice
if x$a = x exit
: nm
echo /bin/nm
cc -s -O nm.c
mv -f a.out /bin/nm
chmod 755 /bin/nm
chown bin /bin/nm
if x$a = x exit
: nohup
echo /usr/bin/nohup
cc -s -O nohup.c
mv -f a.out /usr/bin/nohup
chmod 755 /usr/bin/nohup
chown bin /usr/bin/nohup
if x$a = x exit
: od
echo /bin/od
cc -s -O od.c
mv -f a.out /bin/od
chmod 755 /bin/od
chown bin /bin/od
