我想要一种简单的方法来使用一个小脚本将相同的文本(例如“再见”或更多行)添加到一组文件中。我在脚本中尝试了一些东西ed
,vi
但它没有用。
编辑:我编辑这个评论更具体:
我有文件 c0001.gin c0002.gin ... 最多可以说 500。我需要在每个文件的末尾添加下一个文本:
species
Ca core 2.00000000
Co core 2.00000000
C core 1.34353898
O core 1.01848700
O shel -2.13300000
buck intra
O core O core 4030.3000 0.245497 0.00000000 0.00 2.50 1 0 0
buck
Ca core O shel 2154.0600 0.289118 0.00000000 0.00 10.00 1 0 0
Co core O shel 1095.6000 0.286300 0.00000000 0.00 10.00 1 0 0
Ca core C core 120000000.000 0.120000 0.00000000 0.00 10.00 1 0 0
Co core C core 95757575.760 0.120000 0.00000000 0.00 10.00 1 0 0
buck inter
O shel O shel 64242.454 0.198913 21.843570 0.00 15.00 1 0 0
morse intra bond
C core O core 5.0000000 2.5228 1.19820 0.0000 1 0
three
C core O core O core 1.7995 120.00
outofplane bond intra
C cor O cor O cor O cor 8.6892 360.0
spring
O 52.740087
我只想要一个脚本来做到这一点。
此外,这些文件位于名为“CALCS”的文件夹中,我想将每个文件移动到 CALCS 内的另一个文件夹,名为“001”的 c0001.gin,“002”的文件 c0002.gin 等等。
提前致谢