Friday, May 30, 2008

Script to apply a patch to NS-2

This script will apply any patch the user wants. Just give URL of the patch when the script asks.

# Downloading the requested patch
cd ~/.
cd ns-2
mkdir tempPatch
cd tempPatch
echo "Give the URL of patch. I will download and patch it for you."
read ans
sudo wget $ans
cp $file $dir2
cd $dir2

# Applying the patch
make clean
patch -p1 < $file
rm -rf $HOME/ns-2/tempPatch
sudo make
sudo make install

No comments: