#!/bin/sh # # RUN AT YOUR OWN RISK!!!!!!!!!!!! # THIS SCRIPT CREATES AND DESTROYS FILES AND DIRECTORIES! # # NOTE: The answer file assumes that the editor vi # has been replaced by the code in pas01Vi.txt. # That is: # download pas01Vi.txt from this web site into the same directory as this test # mv pas01Vi.txt vi # chmod a+x vi # All vi is doing is announcing what file it is editing and then does nothing more # # This script is provided as information not intended to execute # on your machine. # runs in the TestWorld directory PATH=`pwd`:$PATH # pwd # echo $PATH # echo "what commands do you exec?" # which vi hi ee el backup star echo echo "* ================================================ *" echo "| Tests for CS270 Assignment 1 |" echo "| Comparison with Expected Output |" echo "* ================================================ *" echo echo "=======================================" echo "HI" hi hi there echo do setup for next tests rm -f mollusks frogs toads snakes rm -f .ee-lastfile-edited # cd Animals EDITOR=vi # vi will be replaced with something that prints out its arguments export EDITOR echo echo "=======================================" echo "EE" echo "try simple ee with no args" ee echo "try ee mollusks" cat < frogs echo "asp" > snakes echo "bufo" > toads echo echo backup frogs snakes backup frogs snakes echo echo 'Any Backups?' ls -d Backup-* | sed 's/[a-zA-Z]*-[0-9]*-[0-9]*/Mon-Day-Year/' echo "What's in backup?" ls Backup-* echo echo backup toads backup toads echo "What's in backup?" ls Backup-* echo echo backup toads backup toads echo "What's in backup?" ls Backup-* echo echo "=======================================" echo "STAR" rm -f frogs*tar star-stuff*tar echo star star-stuff frogs snakes toads star star-stuff frogs snakes toads echo Return code is $? ls *.tar | egrep -v 'CS270|tests' echo "What's in the tar:" tar tf star-stuff.tar echo echo star star-stuff frogs snakes toads star star-stuff frogs snakes toads echo Return code is $? ls *.tar | egrep -v 'CS270|tests' echo "What's in the tar:" tar tf star-stuff.tar echo echo star star-stuff.tar frogs snakes toads star star-stuff.tar frogs snakes toads echo Return code is $? ls *.tar | egrep -v 'CS270|tests' echo "What's in .tar:" tar tf star-stuff.tar echo "What's in .tar.tar:" tar tf star-stuff.tar.tar echo echo star frogs snakes toads star frogs snakes toads echo Return code is $? ls *.tar | egrep -v 'CS270|tests' echo "What's in the tar:" tar tf star-stuff.tar rm -rf star-stuff* echo echo "END OF TESTS"