<?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: About the script writing in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117851#M74853</link>
    <description>You possibly could, if it was always a fixed number of fields, and a fixed number of lines, in combination with 'tail'.&lt;BR /&gt;&lt;BR /&gt;tail --lines=2 system1.txt | cut -f9-10&lt;BR /&gt;&lt;BR /&gt;would be close, but not in the format listed above.</description>
    <pubDate>Thu, 13 Nov 2003 00:58:24 GMT</pubDate>
    <dc:creator>Stuart Browne</dc:creator>
    <dc:date>2003-11-13T00:58:24Z</dc:date>
    <item>
      <title>About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117848#M74850</link>
      <description>I have the following report on the shell , how can I cut the field of last two columns and rows ( 49 , 50 , 59 , 60 ) and paste it to other file ? thx&lt;BR /&gt;&lt;BR /&gt;#vi system1.txt&lt;BR /&gt;01 02 03 04 05 06 07 08 09 10&lt;BR /&gt;11 12 13 14 15 16 17 18 19 20 &lt;BR /&gt;21 22 23 24 25 26 27 28 29 30&lt;BR /&gt;31 32 33 34 35 36 37 38 39 40&lt;BR /&gt;41 42 43 44 45 46 47 48 49 50&lt;BR /&gt;51 52 53 54 55 56 57 58 59 60</description>
      <pubDate>Wed, 12 Nov 2003 22:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117848#M74850</guid>
      <dc:creator>eric_204</dc:creator>
      <dc:date>2003-11-12T22:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117849#M74851</link>
      <description>awk is your friend.&lt;BR /&gt;&lt;BR /&gt;awk 'END {&lt;BR /&gt;  printf( "%s, %s, %s, %s\n", PrevOne, PrevTwo, LastOne, LastTwo );&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;        PrevOne = LastOne;&lt;BR /&gt;        PrevTwo = LastTwo;&lt;BR /&gt;        LastOne = $(NF - 1);&lt;BR /&gt;        LastTwo = $(NF);&lt;BR /&gt;}' &amp;lt; system1.txt&lt;BR /&gt;&lt;BR /&gt;Not the most neat/elegant, but it works.</description>
      <pubDate>Wed, 12 Nov 2003 22:34:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117849#M74851</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2003-11-12T22:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117850#M74852</link>
      <description>can I simply use the "cut" comamand ? thx</description>
      <pubDate>Thu, 13 Nov 2003 00:38:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117850#M74852</guid>
      <dc:creator>eric_204</dc:creator>
      <dc:date>2003-11-13T00:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117851#M74853</link>
      <description>You possibly could, if it was always a fixed number of fields, and a fixed number of lines, in combination with 'tail'.&lt;BR /&gt;&lt;BR /&gt;tail --lines=2 system1.txt | cut -f9-10&lt;BR /&gt;&lt;BR /&gt;would be close, but not in the format listed above.</description>
      <pubDate>Thu, 13 Nov 2003 00:58:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117851#M74853</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2003-11-13T00:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117852#M74854</link>
      <description>Very neat..!&lt;BR /&gt;had been trying my hand at it when you can out with it...&lt;BR /&gt;&lt;BR /&gt;J-P (0 point for this just a comment, thanks.)</description>
      <pubDate>Thu, 13 Nov 2003 01:31:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117852#M74854</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2003-11-13T01:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117853#M74855</link>
      <description>Actually, that last cut thing doesn't work on Linux.  At least not in my version of cut because the defaukt delimiter is a tab.&lt;BR /&gt; &lt;BR /&gt;tail -2 system1.txt | cut -d " " -f 9-10&lt;BR /&gt; &lt;BR /&gt;works for me though.</description>
      <pubDate>Thu, 13 Nov 2003 01:40:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117853#M74855</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-13T01:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117854#M74856</link>
      <description>thx all reply , another question ,&lt;BR /&gt;how can i cut this characters "49,50,59,60" from the file "a.txt" and then paste it to another file "b.txt" in a specific position ? thx&lt;BR /&gt;&lt;BR /&gt;$vi b.txt&lt;BR /&gt;&amp;lt;----------blank----------&amp;gt;&lt;BR /&gt;&amp;lt;--blank-&amp;gt;49 50&amp;lt;--blank---&amp;gt;     &lt;BR /&gt;&amp;lt;--blank-&amp;gt;59 60&amp;lt;--blank---&amp;gt;</description>
      <pubDate>Thu, 13 Nov 2003 01:52:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117854#M74856</guid>
      <dc:creator>eric_204</dc:creator>
      <dc:date>2003-11-13T01:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117855#M74857</link>
      <description>eric, &lt;BR /&gt; &lt;BR /&gt;I think we are now moving away from the realm of one liners :)&lt;BR /&gt; &lt;BR /&gt;Could you be a bit more specific about where in the second file you want the number to appear.</description>
      <pubDate>Thu, 13 Nov 2003 02:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117855#M74857</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-13T02:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117856#M74858</link>
      <description>hi Mark ,&lt;BR /&gt;&lt;BR /&gt;I just want the characters paste to the third column ( leave the first two column blank ) , how to do it ? thx.</description>
      <pubDate>Thu, 13 Nov 2003 02:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117856#M74858</guid>
      <dc:creator>eric_204</dc:creator>
      <dc:date>2003-11-13T02:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117857#M74859</link>
      <description>This works, though it might be better to put it in a script of it's own rather than just running it from the command line&lt;BR /&gt;  &lt;BR /&gt;tail -2 a.txt | cut -d " " -f 9-10 | {&lt;BR /&gt;echo&lt;BR /&gt;while read a&lt;BR /&gt;do&lt;BR /&gt;echo "   $a"&lt;BR /&gt;done&lt;BR /&gt;echo&lt;BR /&gt;} &amp;gt; b.txt&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Nov 2003 02:28:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117857#M74859</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-13T02:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117858#M74860</link>
      <description>Actually, the thing I just posted above assumes you are starting with your original system1.txt&lt;BR /&gt;file, not just those four numbers.</description>
      <pubDate>Thu, 13 Nov 2003 02:31:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117858#M74860</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-13T02:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117859#M74861</link>
      <description>thx Mark, my second requirement is paste the numbers to the third column , could suggest how to do it ? thx.</description>
      <pubDate>Thu, 13 Nov 2003 03:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117859#M74861</guid>
      <dc:creator>eric_204</dc:creator>
      <dc:date>2003-11-13T03:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: About the script writing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117860#M74862</link>
      <description>Hi eric,&lt;BR /&gt; &lt;BR /&gt;I think you just need to have an appropriate number of spaces before the $a in this bit&lt;BR /&gt; &lt;BR /&gt;echo "&amp;lt;-spaces-&amp;gt; $a"&lt;BR /&gt; &lt;BR /&gt;Unless I am misunderstanding you.</description>
      <pubDate>Thu, 13 Nov 2003 03:47:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/about-the-script-writing/m-p/3117860#M74862</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-13T03:47:42Z</dc:date>
    </item>
  </channel>
</rss>

