#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2001-08-03 16:55 IST by <uday@uday-pc.cse.iitb.ernet.in>.
# Source directory was `/home/uday/public_html/softlab/assg2'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    146 -rwxrw-r-- 0.sh
#    304 -rwxrw-r-- 1.sh
#    278 -rwxrw-r-- 2.sh
#    160 -rwxrw-r-- bundle
#    704 -rwxrw-r-- cal
#    252 -rw-r--r-- cleanup.sh
#    947 -rwxrwxr-x gen.sh
#    316 -rw-r--r-- mod.sh
#    183 -rw-rw-r-- notes
#    166 -rw-rw-r-- test_programs.sh
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh11129; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= 0.sh ==============
if test -f '0.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING '0.sh' '(file already exists)'
else
  $echo 'x -' extracting '0.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > '0.sh' &&
cat >| file <<END
$*
END
# Version 1.1 : accept the file name as $1
# Version 1.2 : accept the input as $2
# Version 1.3 : accept the input as $*
SHAR_EOF
  (set 20 01 08 03 16 51 15 '0.sh'; eval "$shar_touch") &&
  chmod 0764 '0.sh' ||
  $echo 'restore of' '0.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo '0.sh:' 'MD5 check failed'
ab7065611c79bb2fa6545ecbf47a19b8  0.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '0.sh'`"
    test 146 -eq "$shar_count" ||
    $echo '0.sh:' 'original size' '146,' 'current size' "$shar_count!"
  fi
fi
# ============= 1.sh ==============
if test -f '1.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING '1.sh' '(file already exists)'
else
  $echo 'x -' extracting '1.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > '1.sh' &&
for i 
do
X	echo $i
done
# Version 1.1 : Use a list by specifying the keyword "in" preceded by the list
# Version 1.1 : Use a list by creating the list from the out of some other 
#               program/command by using back-quotes
#               -- for i in `ls`
#               -- for i in `cat file`
SHAR_EOF
  (set 20 01 08 03 16 53 01 '1.sh'; eval "$shar_touch") &&
  chmod 0764 '1.sh' ||
  $echo 'restore of' '1.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo '1.sh:' 'MD5 check failed'
add33f7953843a4252d9ee5db95cfd10  1.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '1.sh'`"
    test 304 -eq "$shar_count" ||
    $echo '1.sh:' 'original size' '304,' 'current size' "$shar_count!"
  fi
fi
# ============= 2.sh ==============
if test -f '2.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING '2.sh' '(file already exists)'
else
  $echo 'x -' extracting '2.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > '2.sh' &&
for i
do
X	if test -e $i
X	then
X		echo "$i: file exists"
X	else echo "$i: file does not exist"
X	fi
done
# -r for exists and is readable
# -x for exists and is executable
# -w for exists and is writable
# -d for exists and is directory
# -s for exists and has a size greater than 0
SHAR_EOF
  (set 20 01 08 03 16 54 18 '2.sh'; eval "$shar_touch") &&
  chmod 0764 '2.sh' ||
  $echo 'restore of' '2.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo '2.sh:' 'MD5 check failed'
930a0396dd633639ef5bbaa2f87e4fad  2.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '2.sh'`"
    test 278 -eq "$shar_count" ||
    $echo '2.sh:' 'original size' '278,' 'current size' "$shar_count!"
  fi
fi
# ============= bundle ==============
if test -f 'bundle' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'bundle' '(file already exists)'
else
  $echo 'x -' extracting 'bundle' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'bundle' &&
# bundle : group files together
X
echo "# To unbundle, sh this file"
for i
do
X	echo "echo $i 1>&2"
X	echo "cat >$i << 'End of $i'"
X	cat $i
X	echo "End of $i"
done
SHAR_EOF
  (set 20 01 08 03 12 49 43 'bundle'; eval "$shar_touch") &&
  chmod 0764 'bundle' ||
  $echo 'restore of' 'bundle' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'bundle:' 'MD5 check failed'
1bd3fe6c7188e9e6d18d559b816df013  bundle
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bundle'`"
    test 160 -eq "$shar_count" ||
    $echo 'bundle:' 'original size' '160,' 'current size' "$shar_count!"
  fi
fi
# ============= cal ==============
if test -f 'cal' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'cal' '(file already exists)'
else
  $echo 'x -' extracting 'cal' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'cal' &&
# cal : nicer interface to /usr/bin/cal
X
X
case $# in
0)	set `date`; month=$2; year=$6;; 
X     # date command is used to set the values of 
X     # month and year to current month and year
1)  month=$1; set `date`; year=$6;; 
X     # month is given, get the year from date
*)  month=$1; year=$2;;
esac
X
case $month in
jan*|Jan*)	month=1 ;;
feb*|Feb*)	month=2 ;;
mar*|Mar*)	month=3 ;;
apr*|Apr*)	month=4 ;;
may*|May*)	month=5 ;;
jun*|Jun*)	month=6 ;;
jul*|Jul*)	month=7 ;;
aug*|Aug*)	month=8 ;;
sep*|Sep*)	month=9 ;;
oct*|Oct*)	month=10 ;;
nov*|Nov*)	month=11 ;;
dec*|Dec*)	month=12 ;;
[1-9]|10|11|12)  ;;  # User may have given numeric value for month (default case above)
X
esac
X
/usr/bin/cal $month $year
X
SHAR_EOF
  (set 20 01 08 03 16 25 51 'cal'; eval "$shar_touch") &&
  chmod 0764 'cal' ||
  $echo 'restore of' 'cal' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'cal:' 'MD5 check failed'
18325d90257eb2ca2d573d834b710a8d  cal
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'cal'`"
    test 704 -eq "$shar_count" ||
    $echo 'cal:' 'original size' '704,' 'current size' "$shar_count!"
  fi
fi
# ============= cleanup.sh ==============
if test -f 'cleanup.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'cleanup.sh' '(file already exists)'
else
  $echo 'x -' extracting 'cleanup.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'cleanup.sh' &&
for DIR in "." LanguageDesign LowLevelTools HighLevelTools Analysis Synthesis
do	
X	rm -f $DIR/*.dvi $DIR/*.ps $DIR/*.out $DIR/*.log $DIR/*.aux $DIR/*.bak $DIR/*.toc
X	rm -f $DIR/*.goals $DIR/*.decisions $DIR/*.issues $DIR/*.txt $DIR/*,v $DIR/*.old
done
SHAR_EOF
  (set 20 01 08 03 12 25 42 'cleanup.sh'; eval "$shar_touch") &&
  chmod 0644 'cleanup.sh' ||
  $echo 'restore of' 'cleanup.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'cleanup.sh:' 'MD5 check failed'
1882f87c3ed9309925122405ce9343f1  cleanup.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'cleanup.sh'`"
    test 252 -eq "$shar_count" ||
    $echo 'cleanup.sh:' 'original size' '252,' 'current size' "$shar_count!"
  fi
fi
# ============= gen.sh ==============
if test -f 'gen.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'gen.sh' '(file already exists)'
else
  $echo 'x -' extracting 'gen.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'gen.sh' &&
case $# in
X	0) echo 'Usage: gen.sh section [mirror]';
X	   echo '   section = [maths|aptitude]';;
X	1) case $1 in
X	   	clean) make clean;;
X		maths) export SECTION=$1; 
X		       make;;
X		aptitude) export SECTION=$1; 
X		       make;;
X		    *) echo 'Usage: gen.sh section [mirror]';
X	   	       echo '   section = [maths|aptitude]';;
X	   esac ;;
X	2) case $1 in
X	   	clean) make clean;;
X		maths) export SECTION=$1; 
X		       make;;
X		aptitude) export SECTION=$1; 
X		       make;;
X		    *) echo 'Usage: gen.sh section [mirror]';
X	   	       echo '   section = [maths|aptitude]';
X		       exit 1;;
X	   esac ;
X	   case $2 in 
X	    	mirror) for shuffle in A B C D
X	   		do 
X			   	mirror < $SECTION"qpaper"$shuffle.ps > $SECTION"qpaper"$shuffle"M".ps 
X			done;;
X		*) echo 'Usage: gen.sh section [mirror]';
X	   	   echo '   section = [maths|aptitude]';;
X	    esac ;;
X	*) echo 'Usage: gen.sh section [mirror]';
X	   echo '   section = [maths|aptitude]';;
esac
SHAR_EOF
  (set 20 01 08 03 12 50 17 'gen.sh'; eval "$shar_touch") &&
  chmod 0775 'gen.sh' ||
  $echo 'restore of' 'gen.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'gen.sh:' 'MD5 check failed'
1138d82c3e303c816928e024c442d39e  gen.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'gen.sh'`"
    test 947 -eq "$shar_count" ||
    $echo 'gen.sh:' 'original size' '947,' 'current size' "$shar_count!"
  fi
fi
# ============= mod.sh ==============
if test -f 'mod.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mod.sh' '(file already exists)'
else
  $echo 'x -' extracting 'mod.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mod.sh' &&
for dir in `ls` 
do
X	if 
X		test -d $dir
X	then echo $dir
X		 echo "Directory is " $dir >> diff.mesg
X		for file in `ls $dir/*.htm`
X		do	
X			echo $file
X			sed 's/Topic /Lecture /g' $file > $file.temp
X			echo "File name is " $file >> diff.mesg
X			diff $file $file.temp >> diff.mesg
X			mv $file.temp $file
X		done
X	fi
done
SHAR_EOF
  (set 20 01 08 03 12 20 30 'mod.sh'; eval "$shar_touch") &&
  chmod 0644 'mod.sh' ||
  $echo 'restore of' 'mod.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'mod.sh:' 'MD5 check failed'
424387d567df1a05d8a306d1d6cbdcab  mod.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'mod.sh'`"
    test 316 -eq "$shar_count" ||
    $echo 'mod.sh:' 'original size' '316,' 'current size' "$shar_count!"
  fi
fi
# ============= notes ==============
if test -f 'notes' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'notes' '(file already exists)'
else
  $echo 'x -' extracting 'notes' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'notes' &&
Create, delete, rename files/directories
edit files
navigation in the file system
execution - executable files, file permissin
i/o redirection -- from/to file/program
safe cp mv rm >
SHAR_EOF
  (set 20 01 08 03 15 02 11 'notes'; eval "$shar_touch") &&
  chmod 0664 'notes' ||
  $echo 'restore of' 'notes' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'notes:' 'MD5 check failed'
52f85476429c53a9bdff435ec321d1fb  notes
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'notes'`"
    test 183 -eq "$shar_count" ||
    $echo 'notes:' 'original size' '183,' 'current size' "$shar_count!"
  fi
fi
# ============= test_programs.sh ==============
if test -f 'test_programs.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'test_programs.sh' '(file already exists)'
else
  $echo 'x -' extracting 'test_programs.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'test_programs.sh' &&
rm -f testresult
for testfile in `ls ~/courses/cc/tiger/testcases`
do 
X	echo $testfile >> testresult
X	tcc < ~/courses/cc/tiger/testcases/$testfile >> testresult
done
SHAR_EOF
  (set 20 01 08 03 12 37 38 'test_programs.sh'; eval "$shar_touch") &&
  chmod 0664 'test_programs.sh' ||
  $echo 'restore of' 'test_programs.sh' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'test_programs.sh:' 'MD5 check failed'
ba9d048ad405b4fdeb6e5e7d883c1d41  test_programs.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'test_programs.sh'`"
    test 166 -eq "$shar_count" ||
    $echo 'test_programs.sh:' 'original size' '166,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh11129
exit 0
