Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
[opensuse] Append output to the same line in a file
  • From: "Dirk Moolman" <DirkM@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 19 Mar 2008 11:36:33 +0200
  • Message-id: <350DEB176C3F20459BE245610997FD7F022476E7@xxxxxxxxxxxxxx>
Let me first start with an example:


Testfile:

This is line 1
This is line 2
This is line 3


Script:

for i in `cat testfile`
do
echo $i
done


Output:

This
is
line
1
This
is
line
2
This
is
line
3

First problem - the lines are broken up and not displayed as they were
anymore.


Question:

How can I get the output all on 1 line ? Let's say I want the 3 lines
in the testfile to be all on 1 line, like this:

This is line 1 This is line 2 This is line 3








=====
-----



*** Disclaimer ***

The information contained in this e-mail is confidential and legally privileged
and is intended solely for the addressee and to others who have the authority
to receive it. Access to this e-mail by anyone else is unauthorized and as
such, any disclosure, copying, distribution or any action taken or omitted in
reliance on it is unlawful. If you have received this e-mail in error, please
notify the sender immediately.

The views expressed in this e-mail are the views of the individual sender and
should in no way be construed as the views of the Company.

The Company is not liable to ensure that outgoing e-mails are virus-free.

The Company is not liable, should information or data, for whatever reason, be
corrupted or fail to reach its intended addressee.

The Company is not liable for any loss or damage of whatsoever nature and
howsoever arising resulting from the opening or the use of the information in
this e-mail, including its attachments and links.

The sender of this e-mail is subject to and bound by the terms and conditions
of Company+IBk-s Electronic Communications Usage Policy.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >