<?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: Will &amp;quot;sed&amp;quot; do what I need? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093189#M93451</link>
    <description>&lt;!--!*#--&gt;Bonjour Yvonne,&lt;BR /&gt;&lt;BR /&gt;I dont see those lots of blanks spaces, unless you have them in the input file&lt;BR /&gt;&lt;BR /&gt;Anyway you can add this filter :&lt;BR /&gt;&lt;BR /&gt;-e 's!  *! !g'   ==&amp;gt; be aware that there are 2 space characters : it means one space followed by any number of spaces.&lt;BR /&gt;&lt;BR /&gt;Your command will become : &lt;BR /&gt;&lt;BR /&gt;sed -e '/^$/d' -e 's!\(.*\)!host cp \1 /stage/dst/backup!' -e 's!  *! !g' /tmp/dst.bkfiles &amp;gt; /tmp/dst_bkfiles.sql&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Eric&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Feb 2008 10:41:36 GMT</pubDate>
    <dc:creator>Eric SAUBIGNAC</dc:creator>
    <dc:date>2008-02-19T10:41:36Z</dc:date>
    <item>
      <title>Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093182#M93444</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;I'm writing a script which creates a file containing a list of files with their paths.  What I now need my script to do is create another file which will add "cp" before the path/filename and then add "path" at the end of each line within the first file.  I think "sed" might do what I need but its been so long since I've used this command I've forgotten how.  Any ideas anyone please?</description>
      <pubDate>Mon, 18 Feb 2008 17:27:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093182#M93444</guid>
      <dc:creator>Yvonne Butler</dc:creator>
      <dc:date>2008-02-18T17:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093183#M93445</link>
      <description>I think awk might be easier.  Something like:&lt;BR /&gt;&lt;BR /&gt;{ print "cp", $0, "path" }&lt;BR /&gt;&lt;BR /&gt;I think.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Feb 2008 17:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093183#M93445</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-02-18T17:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093184#M93446</link>
      <description>Bonsoir Yvonne,&lt;BR /&gt;&lt;BR /&gt;Assuming your file YourInputFile contains one absolute path to a file per line you could do like this and obtain what you want in YourOutputFile :&lt;BR /&gt;&lt;BR /&gt;sed 's/^/cp /' &amp;lt; YourInputFile | sed 's/$/ path/' &amp;gt; YourOutputFile&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Mon, 18 Feb 2008 17:53:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093184#M93446</guid>
      <dc:creator>Eric SAUBIGNAC</dc:creator>
      <dc:date>2008-02-18T17:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093185#M93447</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I would think by saying "then add 'path' at the end..." you may mean add the DIRECTORY path in which the file was found.  Thus, '/usr/bin/echo' yields '/usr/bin'.  If so, you could process with:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;    MYPATH=$(dirname $LINE)&lt;BR /&gt;    echo cp ${LINE} ${MYPATH}&lt;BR /&gt;done &amp;lt; file.in &amp;gt; file.out&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 18 Feb 2008 17:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093185#M93447</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-02-18T17:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093186#M93448</link>
      <description>Hi (again) Yyonne:&lt;BR /&gt;&lt;BR /&gt;Duh, I think you mean:&lt;BR /&gt;&lt;BR /&gt;# sed -e 's!\(.*\)!cp \1 /newpath!' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 18 Feb 2008 18:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093186#M93448</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-02-18T18:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093187#M93449</link>
      <description>&amp;gt;Eric: sed 's/^/cp /' &amp;lt; YourInputFile | sed 's/$/ path/'&lt;BR /&gt;&lt;BR /&gt;You can optimize this to one sed with two scripts:&lt;BR /&gt;sed -e 's/^/cp /' -e 's:$: path:'  YourInputFile</description>
      <pubDate>Mon, 18 Feb 2008 23:13:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093187#M93449</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-02-18T23:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093188#M93450</link>
      <description>Thanks to you all for your suggestions.  I've now put together the sed command below to do all of what I need:&lt;BR /&gt;&lt;BR /&gt;sed -e '/^$/d' -e 's!\(.*\)!host cp \1 /stage/dst/backup!' /tmp/dst.bkfiles &amp;gt; /tmp/dst_bkfiles.sql&lt;BR /&gt;&lt;BR /&gt;I now get output into a new file showing something like the following:&lt;BR /&gt;&lt;BR /&gt;host cp /redo1/dst/redo05a.log                                                           /stage/dst/backup&lt;BR /&gt;host cp /redo2/dst/redo05b.log                                                           /stage/dst/backup&lt;BR /&gt;&lt;BR /&gt;This does leave me with lots of blank spaces between the first and second path, but that shouldn't stop the script from running.  Will find out tonight when I try it on a live system.  If anyone knows how to remove numerous blank spaces between the two paths though, I'd be glad to hear from you.&lt;BR /&gt;&lt;BR /&gt;Many thanks to you all again though for reminding me how to use SED!!!!</description>
      <pubDate>Tue, 19 Feb 2008 10:27:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093188#M93450</guid>
      <dc:creator>Yvonne Butler</dc:creator>
      <dc:date>2008-02-19T10:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093189#M93451</link>
      <description>&lt;!--!*#--&gt;Bonjour Yvonne,&lt;BR /&gt;&lt;BR /&gt;I dont see those lots of blanks spaces, unless you have them in the input file&lt;BR /&gt;&lt;BR /&gt;Anyway you can add this filter :&lt;BR /&gt;&lt;BR /&gt;-e 's!  *! !g'   ==&amp;gt; be aware that there are 2 space characters : it means one space followed by any number of spaces.&lt;BR /&gt;&lt;BR /&gt;Your command will become : &lt;BR /&gt;&lt;BR /&gt;sed -e '/^$/d' -e 's!\(.*\)!host cp \1 /stage/dst/backup!' -e 's!  *! !g' /tmp/dst.bkfiles &amp;gt; /tmp/dst_bkfiles.sql&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Eric&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Feb 2008 10:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093189#M93451</guid>
      <dc:creator>Eric SAUBIGNAC</dc:creator>
      <dc:date>2008-02-19T10:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093190#M93452</link>
      <description>Thanks Eric, that's tidied up my output file perfectly.</description>
      <pubDate>Tue, 19 Feb 2008 10:47:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093190#M93452</guid>
      <dc:creator>Yvonne Butler</dc:creator>
      <dc:date>2008-02-19T10:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Will "sed" do what I need?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093191#M93453</link>
      <description>See above.&lt;BR /&gt;&lt;BR /&gt;Many thanks everyone!</description>
      <pubDate>Tue, 19 Feb 2008 10:52:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/will-quot-sed-quot-do-what-i-need/m-p/5093191#M93453</guid>
      <dc:creator>Yvonne Butler</dc:creator>
      <dc:date>2008-02-19T10:52:55Z</dc:date>
    </item>
  </channel>
</rss>

