?? apply-patches.sh
字號:
#!/bin/sh# This program is intended to help keep the XORP modified version of# OSPFD in sync with the ftp site and patches. We keep track of the# applied patches in the file imaginatively titled "applied.patches".# Any patches that have not been applied, the user is queried about.# If they respond positively, the patch is applied.PATCHDIR=`echo $0 | sed 's@/[^/]*$@@'`OSPFDIR=${PATCHDIR}/..# File containing list of applied patchesAPPLIED=${PATCHDIR}/applied.patchestrap exit SIGINTquery_then_do_patch( ) { printf "Apply patch $1 (y/n)? " read OKAY if [ "X${OKAY}" != "Xy" -a "X${OKAY}" != "Y" ] ; then return 1 fi # OSPFD code appears to come from version labelled directories # rather than a versioning system. Change directory path to be # xorp ospf directory FILT="s@+++ ospfd2[^/]*/@+++ ${OSPFDIR}/@" cat $i | sed "${FILT}" | patch return 0}for i in ${PATCHDIR}/patch2.[0-9] ${PATCHDIR}/patch2.[0-9][0-9] ; do grep $i ${APPLIED} >/dev/null 2>&1 if [ $? != 0 ] ; then query_then_do_patch $i if [ $? = 0 ] ; then echo $i >> ${APPLIED} fi else echo "Patch $i already applied." fidone
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -