Simple utility to join lines from a command output.
$ printf 'a\nb\nc\n' a b c $ printf 'a\nb\nc\n' | joinlines a b c $ printf 'a\nb\nc\n' | joinlines , a,b,c $ printf 'a\nb\nc\n' | joinlines : a:b:c $ printf 'a\nb\nc\n' | joinlines ' , ' a , b , c
Simpler than paste
, and allows for separators that span multiple characters (e.g. ' , '
):
$ printf 'a\nb\nc\n' | paste -sd, a,b,c $ printf 'a\nb\nc\n' | paste -sd' , ' a b,c $ printf 'a\nb\nc\n' | joinlines , a,b,c $ printf 'a\nb\nc\n' | joinlines ' , ' a , b , c
This file is part of joinlines.
Copyright © 2017-2020 David Gamba Rios
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.