【发布时间】:2012-10-26 02:13:42
【问题描述】:
我有两个文件。其中一个定义了一组数值对,如下所示(fileA):
1 asm
2 assert
3 bio
4 bootasm
5 bootmain
6 buf
7 cat
8 console
9 defs
10 echo
另一个文件包含一堆值对,如下(fileB):
bio types
bio defs
bio param
bio spinlock
bio buf
bootasm asm
bootasm memlayout
bootasm mmu
bootmain types
bootmain elf
bootmain x86
bootmain memlayout
cat types
cat stat
cat user
我想编写一个脚本,将文件 B 中的值替换为文件 A 中对应的数字。 不管是生成新文件还是更改现有文件B都没有关系。
有什么想法吗? 谢谢
【问题讨论】: