What is an efficient way to replace list of strings with another list in Unix file?

前端 未结 6 509
礼貌的吻别
礼貌的吻别 2020-12-10 03:38

Suppose I have two lists of strings (list A and list B) with the exact same number of entries, N, in each list, and I want to replace all occurrences of the the nth element

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 04:22

    you can do this in bash. Get your lists into arrays.

    listA=(a b c)
    listB=(d e f)
    data=$(

提交回复
热议问题