#!/bin//bash #A2 single run #To run: #chmod +x run.sh #./run.sh function print_usage { echo "Usage: $0 " } if [ "$#" -ne "7" ] then print_usage $0 exit -1 fi #Add any special flags here cc -g -Wall $7 -o encrypt -lpthread if [ "$?" -eq "0" ] then echo "Compilation complete....running encryption" ./encrypt $5 $1 $2 $3 $6 $6.enc $4 else exit -1 fi if [ "$?" -eq "0" ] then echo "Running decryption" ./encrypt -$5 $1 $2 $3 $6.enc $6.dec $4 else exit -1 fi if [ "$?" -eq "0" ] then echo "Checking....." diff -a $6 $6.dec if [ "$?" -eq "0" ] then echo "Success........!!!!!!!!!!!!!!!!!!!)(@@#@%$" fi fi