Skip to content

Latest commit

 

History

History

joinlines

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

joinlines

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

SYNOPSIS

command | joinlines [separator]

LICENSE

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/.