用find命令配合sed就可以解决,这个是Linux开发中常用的方法比如我现在的桌面Linux是Ubuntu 10.04 AMD64系统默认的autoconf是2.65,但是RTEMS 4.10以后需要autoconf 2.68,怎么办呢?大家可以知道AC_PREREQ([2.68]) 这个就是autoconf的版本ricky@ricky-laptop:rtems$ cat configure.ac ## Process this file with autoconf to produce a configure script. ## ## $Id: configure.ac,v 1.35 2011/03/04 18:32:15 ralf Exp $
AC_PREREQ([2.68 ]) AC_INIT([rtems],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) AC_CONFIG_SRCDIR([c]) RTEMS_TOP([.])系统有很多.ac的文件ricky@ricky-laptop:rtems$ find . -name "*.ac" ./doc/tools/configure.ac ./doc/configure.ac ./testsuites/mptests/configure.ac ./testsuites/psxtmtests/configure.ac ./testsuites/sptests/configure.ac ./testsuites/samples/configure.ac ./testsuites/psxtests/configure.ac ......我们批量来修改ricky@ricky-laptop:rtems$ find . -name "*.ac" -exec sed -i "s/2.68/2.65/g" {} /; -print ./doc/tools/configure.ac ./doc/configure.ac ./testsuites/mptests/configure.ac ./testsuites/psxtmtests/configure.ac ./testsuites/sptests/configure.ac ./testsuites/samples/configure.ac ./testsuites/psxtests/configure.ac ./testsuites/tools/generic/configure.ac ./testsuites/tools/configure.ac ./testsuites/configure.ac ./testsuites/tmtests/configure.ac ./testsuites/libtests/configure.ac ./cpukit/configure.ac 再看看ricky@ricky-laptop:rtems$ cat configure.ac ## Process this file with autoconf to produce a configure script. ## ## $Id: configure.ac,v 1.35 2011/03/04 18:32:15 ralf Exp $