Answers for "bash print output to one line"


bash print output to one line

# Basic syntax:
<command_producing_multi-line output> | tr '\n' ' '
# Where:
#	- | sends (pipes) the multi-line output of your command to tr
#	- tr '\n' ' ' translates all new line characters from the multi-line 
#		output to spaces, resulting in all output on a single line. 
# Note, change ' ' to whatever delimiter you want between the lines now
#	displayed on a single line (e.g. ',' or ';' or '|')
Posted by: Guest on December-21-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language