<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem to newline change in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932974#M102385</link>
    <description>John,&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you mean.  When I type the LTIME command just as you have it written (only the data file name is changed) then echo $LTIME I get coma separated output on one line.&lt;BR /&gt;&lt;BR /&gt;When I put it in a script and echo $LTIME from the script I get coma separated output on one line.&lt;BR /&gt;&lt;BR /&gt;I get the same output printed either way.&lt;BR /&gt;&lt;BR /&gt;On a side note though, more is an interactive program, you may get faster results from cat or in this case just&lt;BR /&gt;&lt;BR /&gt;Uniq /tmp/time.txt | awk '{#stuff}'&lt;BR /&gt;&lt;BR /&gt;However, if you want to make certain that there are no new lines in the output printf may be the way to go&lt;BR /&gt;&lt;BR /&gt;Awk '{ printf "%s %s %s, ",$4,$5,$6 }'&lt;BR /&gt;&lt;BR /&gt;The reason this will work and print will not is that print always puts a new line on the end of its string and with printf if you want a new line, you have to put it in manually.  Otherwise it will keep stacking onto the same line.&lt;BR /&gt;&lt;BR /&gt;Hope this helps some&lt;BR /&gt;&lt;BR /&gt;H&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Oct 2005 09:57:56 GMT</pubDate>
    <dc:creator>Howard Marshall</dc:creator>
    <dc:date>2005-10-13T09:57:56Z</dc:date>
    <item>
      <title>Problem to newline change</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932972#M102383</link>
      <description>Hi all,&lt;BR /&gt;I have a very frustrate problem.&lt;BR /&gt;My input file time.txt is:&lt;BR /&gt;mfg      pts/tu       Fri Sep 30 15:24 &lt;BR /&gt;mfg      pts/tu       Fri Sep 30 15:24 &lt;BR /&gt;mfg      pts/tGb      Mon Sep 26 09:01 &lt;BR /&gt;&lt;BR /&gt;And my script I wrote&lt;BR /&gt;LTIME=$(more /tmp/time.txt |uniq |awk '{print $4 " " $5 " " $6 ","}')&lt;BR /&gt;&lt;BR /&gt;If I do this in script I get&lt;BR /&gt;LTIME = Sep 30 15:24,&lt;BR /&gt;Sep 26 09:01,&lt;BR /&gt;&lt;BR /&gt;If I manually run in Unix prompt, I get&lt;BR /&gt;LTIME = Sep 30 15:24, Sep 26 09:01,&lt;BR /&gt;&lt;BR /&gt;How can I get the script having the same output as it is in Unit prompt? (I don't want the newline)</description>
      <pubDate>Tue, 11 Oct 2005 19:59:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932972#M102383</guid>
      <dc:creator>Dummy_Guy</dc:creator>
      <dc:date>2005-10-11T19:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to newline change</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932973#M102384</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Instead of the print u give printf and try. :)&lt;BR /&gt;&lt;BR /&gt;Reagrds&lt;BR /&gt;CS</description>
      <pubDate>Tue, 11 Oct 2005 20:48:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932973#M102384</guid>
      <dc:creator>saju_2</dc:creator>
      <dc:date>2005-10-11T20:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to newline change</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932974#M102385</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you mean.  When I type the LTIME command just as you have it written (only the data file name is changed) then echo $LTIME I get coma separated output on one line.&lt;BR /&gt;&lt;BR /&gt;When I put it in a script and echo $LTIME from the script I get coma separated output on one line.&lt;BR /&gt;&lt;BR /&gt;I get the same output printed either way.&lt;BR /&gt;&lt;BR /&gt;On a side note though, more is an interactive program, you may get faster results from cat or in this case just&lt;BR /&gt;&lt;BR /&gt;Uniq /tmp/time.txt | awk '{#stuff}'&lt;BR /&gt;&lt;BR /&gt;However, if you want to make certain that there are no new lines in the output printf may be the way to go&lt;BR /&gt;&lt;BR /&gt;Awk '{ printf "%s %s %s, ",$4,$5,$6 }'&lt;BR /&gt;&lt;BR /&gt;The reason this will work and print will not is that print always puts a new line on the end of its string and with printf if you want a new line, you have to put it in manually.  Otherwise it will keep stacking onto the same line.&lt;BR /&gt;&lt;BR /&gt;Hope this helps some&lt;BR /&gt;&lt;BR /&gt;H&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2005 09:57:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932974#M102385</guid>
      <dc:creator>Howard Marshall</dc:creator>
      <dc:date>2005-10-13T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to newline change</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932975#M102386</link>
      <description>I found the solution Thank you...&lt;BR /&gt;&lt;BR /&gt;printf does work...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2005 18:21:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-to-newline-change/m-p/4932975#M102386</guid>
      <dc:creator>Dummy_Guy</dc:creator>
      <dc:date>2005-10-13T18:21:38Z</dc:date>
    </item>
  </channel>
</rss>

