<?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: How do I write this scipt in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023305#M909628</link>
    <description>This will add cherry and strawberry to the end of the other fruits:&lt;BR /&gt;&lt;BR /&gt;fruit="apple pear banana"&lt;BR /&gt;&lt;BR /&gt;fruit="$fruit cherry strawberry"&lt;BR /&gt;&lt;BR /&gt;#echo $fruit&lt;BR /&gt;apple pear banana cherry strawberry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You could use awk to add cherry to the middle of the other fruits and strawbwerry to the end:&lt;BR /&gt;&lt;BR /&gt;fruit=`echo $fruit | awk '{print $1_"_cherry_"_$2_"_"_$3_"_strawberry"}'&lt;BR /&gt;&lt;BR /&gt;- replace the underscores with spaces.&lt;BR /&gt;</description>
    <pubDate>Mon, 14 Jul 2003 20:51:42 GMT</pubDate>
    <dc:creator>Ronelle van Niekerk</dc:creator>
    <dc:date>2003-07-14T20:51:42Z</dc:date>
    <item>
      <title>How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023302#M909625</link>
      <description>I want to write a script to modify a variable list, like&lt;BR /&gt;&lt;BR /&gt;fruit="apple pear banana"&lt;BR /&gt;I want to modiy it to something like&lt;BR /&gt;fruit="apple cherry pear banana strawberry"&lt;BR /&gt;&lt;BR /&gt;How do I write this shell command? Thanks</description>
      <pubDate>Mon, 14 Jul 2003 18:52:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023302#M909625</guid>
      <dc:creator>Fonda</dc:creator>
      <dc:date>2003-07-14T18:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023303#M909626</link>
      <description>maybe the shift command&lt;BR /&gt;&lt;BR /&gt;fruit="apple pear bannana"&lt;BR /&gt;var2="stawberry"&lt;BR /&gt;fruit="${fruit}${var2}"&lt;BR /&gt;&lt;BR /&gt;echo $fruit&lt;BR /&gt;&lt;BR /&gt;Output is:&lt;BR /&gt;apple cherry pear banana strawberry&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jul 2003 18:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023303#M909626</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-07-14T18:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023304#M909627</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;YOu will need to where you are going to add your values. To add cherry after apple and strawberry to the end, I would do the following&lt;BR /&gt;&lt;BR /&gt;fruit=$(echo $fruit|sed -e 's/apple/apple cherry/g' -e 's/$/ strawberry/')&lt;BR /&gt;&lt;BR /&gt;There is a space after strawberry in the second sed statement.&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 14 Jul 2003 19:01:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023304#M909627</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-07-14T19:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023305#M909628</link>
      <description>This will add cherry and strawberry to the end of the other fruits:&lt;BR /&gt;&lt;BR /&gt;fruit="apple pear banana"&lt;BR /&gt;&lt;BR /&gt;fruit="$fruit cherry strawberry"&lt;BR /&gt;&lt;BR /&gt;#echo $fruit&lt;BR /&gt;apple pear banana cherry strawberry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You could use awk to add cherry to the middle of the other fruits and strawbwerry to the end:&lt;BR /&gt;&lt;BR /&gt;fruit=`echo $fruit | awk '{print $1_"_cherry_"_$2_"_"_$3_"_strawberry"}'&lt;BR /&gt;&lt;BR /&gt;- replace the underscores with spaces.&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jul 2003 20:51:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023305#M909628</guid>
      <dc:creator>Ronelle van Niekerk</dc:creator>
      <dc:date>2003-07-14T20:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023306#M909629</link>
      <description>you could do something like the attached script does</description>
      <pubDate>Tue, 15 Jul 2003 00:11:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023306#M909629</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-15T00:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this scipt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023307#M909630</link>
      <description>It's quite easy.&lt;BR /&gt;&lt;BR /&gt;fruit="apple pear banana" &lt;BR /&gt;fruit="apple cherry pear banana strawberry" &lt;BR /&gt;&lt;BR /&gt;.. unless you are trying to perform an operation on the original value, but you don't give enough information on what you are really trying to do.&lt;BR /&gt;&lt;BR /&gt;:-&amp;gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jul 2003 07:15:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-this-scipt/m-p/3023307#M909630</guid>
      <dc:creator>Martin Robinson</dc:creator>
      <dc:date>2003-07-15T07:15:04Z</dc:date>
    </item>
  </channel>
</rss>

