Shell script to find, search and replace array of strings in a file

后端 未结 2 1295
逝去的感伤
逝去的感伤 2021-01-22 13:41

This is linked to another question/code-golf i asked on Code golf: "Color highlighting" of repeated text

I\'ve got a file \'sample1.txt\' with the following co

2条回答
  •  逝去的感伤
    2021-01-22 13:49

    Pure Bash (no externals)

    At the Bash command line:

    $ sample="LoremIpsumissimplydummytextoftheprintingandtypesettingindustry.LoremIpsumhasbeentheindustry'sstandarddummytexteversincethe1500s,whenanunknownprintertookagalleyoftypeandscrambledittomakeatypespecimenbook."
    $ # or: sample=$($entry}; fi; done; echo "Output:"; echo $sample
    Output:
    LoremIpsumissimplydummytextoftheprintingandtypesettingindustry.LoremIpsumhasbeentheindustry'sstandarddummytexteversincethe1500s,whenanunknownprintertookagalleyoftypeandscrambledittomakeatypespecimenbook.
    

提交回复
热议问题