【问题标题】:Is there any script or any automation? [closed]是否有任何脚本或任何自动化? [关闭]
【发布时间】:2020-03-24 05:05:57
【问题描述】:

问题陈述:我有 150 个图块(目录),我需要将 .hierdb 文件复制到特定路径。然后我需要将那个 .hierdb 文件复制到这里的 sub_block_hierdb.lst。

例如:

-> cp -rf /proj/disk_2/HDC/PERFRO16_TSMCN7B1.ssgc.lib.gz_1786/hdc/hcdc_PERFRO16_TSMCN7B1.hierdb(source) src/meta/tools/2in/tiles/tile_1(tile_1 to tile_150)/.(destination)
-> gvim src/meta/tools/2in/tiles/tile_1/sub_block_hierdb.lst -> paste -> hcdc_PERFRO16_TSMCN7B1.hierdb

拥有 150 多个图块的任何人都可以告诉我如何编写脚本或自动化。我需要将 .hierdb 文件复制到 150 个图块并粘贴到 sub_block_hierdb.lst 中。

我试过这个:

#!/bin/bash
srcdir="/proj/disk_2/HDC/PERFRO16_TSMCN7B1.ssgc.lib.gz_1786/hdc/hcdc_PERFRO16_TSMCN7B1.hierdb"
tiles=(tile_1 tile_2....tile_150)

for tile in "${tiles[@]}"
do
    dstdir="src/meta/tools/2in/tiles/$tile/."
    cp -rf $srcdir "$dstdir"
    echo "hcdc_PERFRO16_TSMCN7B1.hierdb" >> src/meta/tools/2in/tiles/$tile/sub_block_hierdb.lst
done

【问题讨论】:

标签: python bash shell


【解决方案1】:

使用

tiles=(tile_{1..150})

而不是

tiles=(tile_1 tile_2....tile_150)

【讨论】:

    猜你喜欢
    • 2020-10-02
    • 2015-04-11
    • 2013-01-15
    • 2016-12-28
    • 2017-07-18
    • 2020-05-26
    • 2012-07-10
    • 2016-09-07
    • 1970-01-01
    相关资源
    最近更新 更多