<?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: Adding Single Quotes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180867#M682709</link>
    <description>JRF can you explain the regex for my own understanding.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
    <pubDate>Thu, 11 Jun 2009 21:06:39 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2009-06-11T21:06:39Z</dc:date>
    <item>
      <title>Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180864#M682706</link>
      <description>I want to add single quotes to each entry in a file like this - &lt;BR /&gt;&lt;BR /&gt;'xxxxxx'&lt;BR /&gt;&lt;BR /&gt;currently its just xxxxxx and there are 2000 enteries in all for which I need to add the quotes to.&lt;BR /&gt;&lt;BR /&gt;Currently the file is like this - &lt;BR /&gt;&lt;BR /&gt;xxxxxx&lt;BR /&gt;xxxxxx&lt;BR /&gt;xxxxxx&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;xxxxxx&lt;BR /&gt;&lt;BR /&gt;and want to change this to - &lt;BR /&gt;&lt;BR /&gt;'xxxxxx'&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;'xxxxxx'</description>
      <pubDate>Thu, 11 Jun 2009 20:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180864#M682706</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-06-11T20:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180865#M682707</link>
      <description>Solved it by the echo command.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/unix-dummies-questions-answers/73879-add-single-quotes-string.html" target="_blank"&gt;http://www.unix.com/unix-dummies-questions-answers/73879-add-single-quotes-string.html&lt;/A&gt;</description>
      <pubDate>Thu, 11 Jun 2009 20:55:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180865#M682707</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-06-11T20:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180866#M682708</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# cat ./myfile&lt;BR /&gt;this is something&lt;BR /&gt;another&lt;BR /&gt;thing 1&lt;BR /&gt;thing 2&lt;BR /&gt;here is more&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/(\S+)/\047$1\047/g' myfile&lt;BR /&gt;'this' 'is' 'something'&lt;BR /&gt;'another'&lt;BR /&gt;'thing' '1'&lt;BR /&gt;'thing' '2'&lt;BR /&gt;'here' 'is' 'more'&lt;BR /&gt;&lt;BR /&gt;...and if you want an inplace update:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/(\S+)/\047$1\047/g' myfile&lt;BR /&gt;&lt;BR /&gt;...which automatically backs up the unchanged file as 'myfile.old' too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 11 Jun 2009 20:56:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180866#M682708</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-11T20:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180867#M682709</link>
      <description>JRF can you explain the regex for my own understanding.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 11 Jun 2009 21:06:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180867#M682709</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-06-11T21:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180868#M682710</link>
      <description>Hi (again) Allanm:&lt;BR /&gt;&lt;BR /&gt;The regex substitutes a non-whitespace character sequence with a single quote, the character sequence and another single quote.  A non-whitespace character is denoted by '\S'.  The '+' says one or more of them.  The parenthesis capture what is seen and the '\1' is a backreference to what was last captured.  The '\047' is the Ascii code for a single quote which makes commandline substitution easier to do.  The 'g' says to "g"lobally repeat the substitution as many times as necessary on each line.&lt;BR /&gt;&lt;BR /&gt;Please don't forget to re-open this thread to evaluate these answers :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 11 Jun 2009 21:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180868#M682710</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-11T21:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180869#M682711</link>
      <description>thanks!</description>
      <pubDate>Thu, 11 Jun 2009 21:20:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180869#M682711</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-06-11T21:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Single Quotes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180870#M682712</link>
      <description>I would typically use vi if one file:&lt;BR /&gt;:%s/^/'/&lt;BR /&gt;:%s/$/'/&lt;BR /&gt;Translating to sed:&lt;BR /&gt;sed -e "s/^/'/" -e "s/$/'/" file&lt;BR /&gt;Or harder:&lt;BR /&gt;sed -e "s/^\(.*\)\$/\'\1'/" file</description>
      <pubDate>Fri, 12 Jun 2009 05:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-single-quotes/m-p/5180870#M682712</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-12T05:16:11Z</dc:date>
    </item>
  </channel>
</rss>

