<?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: SED help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107569#M91376</link>
    <description>What do you mean "." from the end of a path?&lt;BR /&gt;&lt;BR /&gt;If you mean the "." at the very end you can use: -e 's/\.$//'&lt;BR /&gt;If you mean remove a "." component from a PATH component you could use:&lt;BR /&gt;sed -e 's!:.:!:g' -e 's/:\.$//'</description>
    <pubDate>Wed, 07 May 2008 10:30:08 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-05-07T10:30:08Z</dc:date>
    <item>
      <title>SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107564#M91371</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I want to remove a "." from the end of the path from a users profile and want to use sed.&lt;BR /&gt;&lt;BR /&gt;I use this string to determine to determine the period "." in an if statement:&lt;BR /&gt;&lt;BR /&gt;echo $PATH |awk -F":" '/\.$/ {print $NF}'&lt;BR /&gt;&lt;BR /&gt;if true what is the best way to use sed to remove the ".":&lt;BR /&gt;&lt;BR /&gt;my method:&lt;BR /&gt;&lt;BR /&gt;if [[ $(echo $PATH |awk '/\./ {print NF}') -gt  "0" ]] ; then &lt;BR /&gt;&lt;BR /&gt;cp /home/&lt;USER&gt;/.profile /home/&lt;USER&gt;/.profile.bck&lt;BR /&gt;&lt;BR /&gt;then I have difficulty replacing the . from the profile and recreate the .profile ....&lt;BR /&gt;&lt;BR /&gt;can anyone please help?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;Chris.&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Wed, 07 May 2008 09:06:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107564#M91371</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-05-07T09:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107565#M91372</link>
      <description>Why echo the entire path?&lt;BR /&gt;&lt;BR /&gt;Why don't you use the form of the ls command to list just the file name.&lt;BR /&gt;&lt;BR /&gt;ls -&lt;OPTIONS&gt; &lt;PATH&gt;/.profile&lt;BR /&gt;&lt;BR /&gt;So it shows up as &lt;BR /&gt;.profile&lt;BR /&gt;&lt;BR /&gt;Then pipe that to tr and do a tr "." ""&lt;BR /&gt;&lt;BR /&gt;I don't have access to a system today so I didnt' test the tr syntax.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or if you want to just replace the . at the beginning of the&lt;BR /&gt;  .profile&lt;BR /&gt;&lt;BR /&gt;Pipe it to sed -e 's/^.//g'&lt;BR /&gt;that should work.  May have to \ out the . though.&lt;BR /&gt;&lt;/PATH&gt;&lt;/OPTIONS&gt;</description>
      <pubDate>Wed, 07 May 2008 09:16:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107565#M91372</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-05-07T09:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107566#M91373</link>
      <description>I dont think your answer will work ....&lt;BR /&gt;&lt;BR /&gt;I only echo the path of the user in this example however I will check the .profile of the user I need to change.&lt;BR /&gt;&lt;BR /&gt;I cannot use &lt;BR /&gt;&lt;BR /&gt;# sed 's/\.//' as this will remove any other "." from the profile so all I am intereted in is the ^PATH=* then recreate the file without the "." in the path.&lt;BR /&gt;&lt;BR /&gt;thanks anyway.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 May 2008 09:30:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107566#M91373</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-05-07T09:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107567#M91374</link>
      <description>Instead of changing the sed statement change the path you provide to ls.&lt;BR /&gt;&lt;BR /&gt;Then my solution may work.&lt;BR /&gt;&lt;BR /&gt;And put a ^ in the sed statement  ^\. to indicate to find only the . at the beginning.&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Wed, 07 May 2008 09:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107567#M91374</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-05-07T09:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107568#M91375</link>
      <description>ok well thanks but maybe I didnt explain very well however came up with this solution:&lt;BR /&gt;&lt;BR /&gt;if [[ $(awk '/^PATH.+\.$/ {print NF}' /home/ca/.profile) -gt "0" ]] ; then&lt;BR /&gt;&lt;BR /&gt;cp /home/ca/.profile /home/ca/.profile.bck&lt;BR /&gt;&lt;BR /&gt;cat /home/ca/.profile.bck |sed -e '/^PATH/s/\.//' &amp;gt; /home/ca/.profile&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;is this a logical method?</description>
      <pubDate>Wed, 07 May 2008 10:13:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107568#M91375</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-05-07T10:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107569#M91376</link>
      <description>What do you mean "." from the end of a path?&lt;BR /&gt;&lt;BR /&gt;If you mean the "." at the very end you can use: -e 's/\.$//'&lt;BR /&gt;If you mean remove a "." component from a PATH component you could use:&lt;BR /&gt;sed -e 's!:.:!:g' -e 's/:\.$//'</description>
      <pubDate>Wed, 07 May 2008 10:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107569#M91376</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-07T10:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107570#M91377</link>
      <description>ok so the system is AIX and sometimes the systems are configured so the path has PATH:*:. at the end in .profile ....&lt;BR /&gt;&lt;BR /&gt;if I just run s/\.$//' then this will remove any "." from the profile.&lt;BR /&gt;&lt;BR /&gt;I will take a look at the component method so thanks ...</description>
      <pubDate>Wed, 07 May 2008 10:47:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107570#M91377</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-05-07T10:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: SED help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107571#M91378</link>
      <description>thanks both</description>
      <pubDate>Wed, 07 May 2008 10:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-help/m-p/5107571#M91378</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-05-07T10:48:32Z</dc:date>
    </item>
  </channel>
</rss>

