#!/bin/sh# Check if both a starting file and patch are providedif [ $# != 2 ]; thenecho "usage: <first_file.cpp> <patch.txt>"echo "specified patch will be applied to first_file.cpp and every code file larger than it (from later chapters)"exit 1fi# Iterate over code files in order of increasing size# i.e. in order of chapters (every chapter adds code)apply_patch=falsefor f in `ls -Sr *.cpp`do# Apply patch on every code file including and after initial oneif [ $f = 1ドル ] || [ $apply_patch = true ]; thenapply_patch=truepatch -f $f < 2ドル | grep -q "FAILED" > /dev/nullif [ $? = 0 ]; thenecho "failed to apply patch to $f"exit 1firm -f *.origfidoneecho "patch successfully applied to all files"exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。