Combine multiple lines starting with same phrase into one
-1
votes
2
answers
122
views
I'm writing a Bash script to convert Arch Linux packages into a format for a package manager I'm writing, and I have to convert some metadata files into file format
.toml
. Previously, I've been using sed
, but I just need something I can implement into a Bash script. The conversion should look like shown below.
Input:
... other stuff ...
depends = "some-dependency"
depends = "another-dependency"
depends = "yet-another-dependency"
Output:
... other stuff already converted ...
depends = [ "some-dependency", "another-dependency", "yet-another-dependency" ]
Asked by universeindex
(7 rep)
Feb 19, 2023, 12:09 AM
Last activity: Feb 21, 2023, 08:44 PM
Last activity: Feb 21, 2023, 08:44 PM