Bash Combine Output On One Line

[Solved] Bash Combine Output On One Line | Basic - Code Explorer | yomemimo.com
Question : bash combine output on one line

Answered by : charlesalexandre-roy

# Basic syntax:
command_producing_multi-line_output | tr '\n' ' '
# Where:
#	- | sends (pipes) the multi-line output of your command to tr
#	- tr '\n' ' ' 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 : https://stackoverflow.com/questions/15580144/how-to-concatenate-multiple-lines-of-output-to-one-line | Last Update : Mon, 28 Dec 20

Answers related to bash combine output on one line

Code Explorer Popular Question For Basic