?? patch.sh
字號(hào):
#!/bin/shSRC_DIR=`pwd`if [ -z "$1" ] then echo "usage: ./patch.sh path_to_ns" exit 1fiif [ ! -e $SRC_DIR/patch ] then echo "run patch.sh in its original directory (./patch)" exit 1fiif [ -e $1/queue/cbq.cc ] then DST_DIR=$1elif [ -e $1/ns-2*/queue/cbq.cc ] then DST_DIR="$1/ns-2*"else echo "source tree to patch not found";exit 1fiechoecho -n "copying wfq files ... "cp $SRC_DIR/src/*.cc $DST_DIR/queuecp $SRC_DIR/src/*.h $DST_DIR/queueecho "done"cd $DST_DIRecho -n "patching Makefile.in ... "cat $SRC_DIR/patch/patch_Makefile.in | patch -p1 -N -s && echo "done"echo -n "patching tcl/lib/ns-default.tcl ... "cat $SRC_DIR/patch/patch_ns-default.tcl | patch -p1 -N -s && echo "done"NS2_VERSION=`cat VERSION`echo -n "patching tcl/lib/ns-lib.tcl ... "if [[ $NS2_VERSION < "2.28" ]]; then cat $SRC_DIR/patch/patch_ns-lib.tcl | patch -p1 -N -s && echo "done"elif [[ $NS2_VERSION = "2.28" ]]; then cat $SRC_DIR/patch/patch_ns-lib.tcl.2.28 | patch -p1 -N -s && echo "done"elif [[ $NS2_VERSION > "2.28" ]]; then cat $SRC_DIR/patch/patch_ns-lib.tcl.2.29 | patch -p1 -N -s && echo "done"fiechoexit 0
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -