Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash concatenate output on one line

# Basic syntax:
command_producing_multi-line_output | tr '
' ' '
# Where:
#	- | sends (pipes) the multi-line output of your command to tr
#	- tr '
' ' ' converts (translates) all new line characters from the
#		multi-line output to spaces, resulting in a single line 
# Note, change ' ' to whatever delimiter you want between the lines now
#	displayed on a single line (e.g. ',' or ';' or '|')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #concatenate #output #line
ADD COMMENT
Topic
Name
3+6 =