#!/bin/sh
export CLASSPATH=.
for i in "1" "2" "3" "4" "5"
do
echo "running simulation $i..."
cd /home/acharya/ns-allinone-2.35/ns-2.35/
./ns /home/acharya/Desktop/xx/wrls.tcl
mv conf-out-tdsr.tr /home/acharya/Desktop/xx/parser
mv monitorlog.txt /home/acharya/Desktop/xx/parser/r2/evil$2/scen$i
mv reputationlog.txt /home/acharya/Desktop/xx/parser/evil$2/scen$i
mv pathmanagerlog.txt /home/acharya/Desktop/xx/parser/r2/evil$2/scen$i
mv misbehavenodeslog.txt /home/acharya/Desktop/xx/parser/r2/evil$2/scen$i
cd /home/acharya/Desktop/xx/parser/
java DSRParser trace conf-out-tdsr.tr $1 $2 > r2/evil$2/scen$i/scen-r2-$i.txt
java DSRParser routestats r2/evil$2/scen$i/pathmanagerlog.txt $1 $2 >> r2/evil$2/scen$i/scen-r2-$i.txt
cd ..done
这是第二个脚本-:
#!/bin/sh
export CLASSPATH=.
#./run1.sh
for i in "0" "10" "20" "30" "40"
do
echo "Simulating evil node no. $i ..."
cp /home/acharya/Desktop/xx/hdr_confidant.hevil$i /home/acharya/ns-allinone-2.35/ns-2.35/dsr/hdr_confidant.h
cd /home/acharya/ns-allinone-2.35/ns-2.35
rm dsr/*.o
make
cd /home/acharya/Desktop/xx/
./run.sh 50 $i
done
这是我想知道的两个shell脚本的含义。
mv monitorlog.txt /home/acharya/Desktop/xx/parser/r2/evil$2/scen$i
关于scen$i
使用的。
cp /home/acharya/Desktop/xx/hdr_confidant.hevil$i
因为文件名只是 hdr_confidant.h 但evil$i
与它一起使用。