Re: [PATCH v6 01/15] help: move list_config_help to builtin/help
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 13, 2020, 23:07 UTC
- Message-ID
- <CAPig+cRDbOyDQm6wx7+fZoKDfehLjkPc3qenR5Mhc8OkeFJqbw@mail.gmail.com>
- In-Reply-To
- <20200213225834.GI190927@google.com>
On Thu, Feb 13, 2020 at 5:58 PM Emily Shaffer <emilyshaffer@google.com> wrote:
Show 12 quoted lines
> On Thu, Feb 06, 2020 at 08:35:33AM +0700, Danh Doan wrote: > > - while read line > > - do > > - echo " \"$line\"," > > - done > > + sed 's/^/ "/; s/$/",/' > > Thanks for the suggestion. You're right that I didn't look into the > contents of this script much, because I was just moving it; I modified > your sed expression slightly so it performs just one operation: > > sed 's/^.*$/ "\0",/'
This isn't portable and won't work with 'sed' from BSD lineage, including Mac OS. More portable would be:
sed 's/^\(.*\)$/ "\1",/'