<?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: Appending Text to End of File in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127829#M804599</link>
    <description>Nag,&lt;BR /&gt;&lt;BR /&gt;The simplest way to append a string of test to the end of an existing file is to use the echo command.  &lt;BR /&gt;&lt;BR /&gt;echo "text to append" &amp;gt;&amp;gt; file&lt;BR /&gt;&lt;BR /&gt;Using the cat command requires that you create a new file with your text to append.&lt;BR /&gt;&lt;BR /&gt;If the directory contains just the 10 files that you want to append to, then you can do the following:&lt;BR /&gt;&lt;BR /&gt;for i in *&lt;BR /&gt;do&lt;BR /&gt;echo "text to append" &amp;gt;&amp;gt; $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JL</description>
    <pubDate>Wed, 26 Nov 2003 11:19:29 GMT</pubDate>
    <dc:creator>James Lynch</dc:creator>
    <dc:date>2003-11-26T11:19:29Z</dc:date>
    <item>
      <title>Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127821#M804591</link>
      <description>Hi,&lt;BR /&gt;I have 10 text files in a directory. I need to apped some text( in file x) to all the files. COuld you please help me achieve this,&lt;BR /&gt;&lt;BR /&gt;I am doing it this way&lt;BR /&gt;&lt;BR /&gt;cat file &amp;gt;&amp;gt; * . This is creating a file *.&lt;BR /&gt;&lt;BR /&gt;Your help is greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Nag</description>
      <pubDate>Tue, 25 Nov 2003 01:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127821#M804591</guid>
      <dc:creator>nagendra_3</dc:creator>
      <dc:date>2003-11-25T01:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127822#M804592</link>
      <description>Hi there.&lt;BR /&gt;Tried this before ?&lt;BR /&gt;&lt;BR /&gt;cat filex &amp;gt;&amp;gt; file1&lt;BR /&gt;cat filex &amp;gt;&amp;gt; file2&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;Alexander M. Ermes</description>
      <pubDate>Tue, 25 Nov 2003 01:59:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127822#M804592</guid>
      <dc:creator>Alexander M. Ermes</dc:creator>
      <dc:date>2003-11-25T01:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127823#M804593</link>
      <description>Hi Nag!&lt;BR /&gt;Do a script that you can call appendfile.sh&lt;BR /&gt;&lt;BR /&gt;then:&lt;BR /&gt;cat filex &amp;gt;&amp;gt; file1&lt;BR /&gt;cat filex &amp;gt;&amp;gt; file2&lt;BR /&gt;cat filex &amp;gt;&amp;gt; file3&lt;BR /&gt;&lt;BR /&gt;and so on....&lt;BR /&gt;&lt;BR /&gt;chmod 755 appendfile .sh&lt;BR /&gt;then execute the file.&lt;BR /&gt;./appendfile.sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//Tommy</description>
      <pubDate>Tue, 25 Nov 2003 02:23:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127823#M804593</guid>
      <dc:creator>TommyT</dc:creator>
      <dc:date>2003-11-25T02:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127824#M804594</link>
      <description>You can avoid repitition by using a loop, eg&lt;BR /&gt;&lt;BR /&gt;for f in f1 f2 f3 f4 f5 f6 f7 f8 f9 f10&lt;BR /&gt;do&lt;BR /&gt;cat x &amp;gt;&amp;gt; $f&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Where f1-f10 are your file names.&lt;BR /&gt;Or, if your 10 files patch a pattern, (eg *.txt), use&lt;BR /&gt;&lt;BR /&gt;for f in *.txt&lt;BR /&gt;do&lt;BR /&gt;cat x &amp;gt;&amp;gt; $f&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;-- Graham</description>
      <pubDate>Tue, 25 Nov 2003 03:36:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127824#M804594</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-11-25T03:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127825#M804595</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the shell does no expansion of things like * after a redirection &amp;gt;. Graham has the simplest solution.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Nov 2003 07:04:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127825#M804595</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-25T07:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127826#M804596</link>
      <description>Give this a try&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;filedir=/dir_where_files_are&lt;BR /&gt;&lt;BR /&gt;files=$(ls $filedir | grep -v fileX)&lt;BR /&gt;&lt;BR /&gt;cat $filedir/fileX &amp;gt;&amp;gt; $files</description>
      <pubDate>Tue, 25 Nov 2003 07:14:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127826#M804596</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-11-25T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127827#M804597</link>
      <description>ignore the post above... this one is better&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;filedir=/dir_where_files_are&lt;BR /&gt;&lt;BR /&gt;files=$(ls $filedir | grep -v fileX)&lt;BR /&gt;for i in $files &lt;BR /&gt;do&lt;BR /&gt;cat $filedir/fileX &amp;gt;&amp;gt; $i</description>
      <pubDate>Tue, 25 Nov 2003 07:28:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127827#M804597</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-11-25T07:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127828#M804598</link>
      <description>Ok... it's either early or I'm retarded :)  I forgot to put a "done" as the last line of the script above.  It should be &lt;BR /&gt;&lt;BR /&gt;ignore the post above... this one is better&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;filedir=/dir_where_files_are&lt;BR /&gt;&lt;BR /&gt;files=$(ls $filedir | grep -v fileX)&lt;BR /&gt;for i in $files&lt;BR /&gt;do&lt;BR /&gt;cat $filedir/fileX &amp;gt;&amp;gt; $i&lt;BR /&gt;done</description>
      <pubDate>Tue, 25 Nov 2003 07:33:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127828#M804598</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-11-25T07:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127829#M804599</link>
      <description>Nag,&lt;BR /&gt;&lt;BR /&gt;The simplest way to append a string of test to the end of an existing file is to use the echo command.  &lt;BR /&gt;&lt;BR /&gt;echo "text to append" &amp;gt;&amp;gt; file&lt;BR /&gt;&lt;BR /&gt;Using the cat command requires that you create a new file with your text to append.&lt;BR /&gt;&lt;BR /&gt;If the directory contains just the 10 files that you want to append to, then you can do the following:&lt;BR /&gt;&lt;BR /&gt;for i in *&lt;BR /&gt;do&lt;BR /&gt;echo "text to append" &amp;gt;&amp;gt; $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JL</description>
      <pubDate>Wed, 26 Nov 2003 11:19:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127829#M804599</guid>
      <dc:creator>James Lynch</dc:creator>
      <dc:date>2003-11-26T11:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127830#M804600</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if the problem is solved, could you spare some points from the endless supply of points, HP has, for those, who could help you? ;-)&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael</description>
      <pubDate>Thu, 27 Nov 2003 08:20:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127830#M804600</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-27T08:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Text to End of File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127831#M804601</link>
      <description>Negendra, i hope that i have understood....&lt;BR /&gt;Considering that the files are only 10, i think to commands manually. &lt;BR /&gt;With the command "vi" (or "ed" or "ex") you extract the part of text from the fileX and saves it in fileY. &lt;BR /&gt;# vi fileX&lt;BR /&gt; &lt;BR /&gt;Then with the command "cat" you append fileY to all the files.&lt;BR /&gt;# cat filey &amp;gt; &amp;gt; file1 &lt;BR /&gt;# cat filey &amp;gt; &amp;gt; file2 &lt;BR /&gt;# cat filey &amp;gt; &amp;gt; file3&lt;BR /&gt;(...repeat for all files)&lt;BR /&gt;&lt;BR /&gt;You can avoid repetition by using a script with cicle "for". &lt;BR /&gt;Like explanation by others answers previous (of others user).&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Bruno</description>
      <pubDate>Fri, 28 Nov 2003 03:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/appending-text-to-end-of-file/m-p/3127831#M804601</guid>
      <dc:creator>Bruno Ganino</dc:creator>
      <dc:date>2003-11-28T03:21:00Z</dc:date>
    </item>
  </channel>
</rss>

