<?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 updating  file in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103184#M91007</link>
    <description>arrhhhgh...I'm having a brain blank this morning.&lt;BR /&gt;&lt;BR /&gt;Want a simple command I can use via ssh to update files across systems.&lt;BR /&gt;&lt;BR /&gt;One example is&lt;BR /&gt;sed -e 's/DISABLETIME=[0-9][0-9]/DISABLETIME=60/1' &amp;lt; ./login &amp;gt; ./login&lt;BR /&gt;&lt;BR /&gt;The problem with this is obviously it will 0 out the file when it writes back.&lt;BR /&gt;&lt;BR /&gt;How could I lookup up DISABLETIME=20 (or any 2 digit value after the =) and replace it with DISABLETIME=60?&lt;BR /&gt;&lt;BR /&gt;This has to plug into an ssh command so I don't want to keep the command as simple as possible to avoid SSH issues.</description>
    <pubDate>Mon, 14 Apr 2008 07:36:36 GMT</pubDate>
    <dc:creator>OFC_EDM</dc:creator>
    <dc:date>2008-04-14T07:36:36Z</dc:date>
    <item>
      <title>updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103184#M91007</link>
      <description>arrhhhgh...I'm having a brain blank this morning.&lt;BR /&gt;&lt;BR /&gt;Want a simple command I can use via ssh to update files across systems.&lt;BR /&gt;&lt;BR /&gt;One example is&lt;BR /&gt;sed -e 's/DISABLETIME=[0-9][0-9]/DISABLETIME=60/1' &amp;lt; ./login &amp;gt; ./login&lt;BR /&gt;&lt;BR /&gt;The problem with this is obviously it will 0 out the file when it writes back.&lt;BR /&gt;&lt;BR /&gt;How could I lookup up DISABLETIME=20 (or any 2 digit value after the =) and replace it with DISABLETIME=60?&lt;BR /&gt;&lt;BR /&gt;This has to plug into an ssh command so I don't want to keep the command as simple as possible to avoid SSH issues.</description>
      <pubDate>Mon, 14 Apr 2008 07:36:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103184#M91007</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-14T07:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103185#M91008</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/\bDISABLETIME=\d\d\b/DISABLETIME=60/' ./login&lt;BR /&gt;&lt;BR /&gt;...will perform an inplace update of the file passed leaving a backup copy as "*.old".&lt;BR /&gt;&lt;BR /&gt;The '\b' bound the match so that you don't get something like DISABLETIME=200 changed to DISABLETIME=600.  The '\d' is a digit.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 14 Apr 2008 10:52:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103185#M91008</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-04-14T10:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103186#M91009</link>
      <description>Thanks James I'll try that out today.&lt;BR /&gt;&lt;BR /&gt;I'd still be interested in a basic way without perl.  &lt;BR /&gt;&lt;BR /&gt;Not that I don't appreciate perl.  They just don't use it here and I want to create a method to leave with the admins here utilizing simple shell and ssh commands.&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Tue, 15 Apr 2008 08:15:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103186#M91009</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-15T08:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103187#M91010</link>
      <description>Now that I've had some sleep.  I've solved this via process instead of a command. Clarity comes with sleep and good coffee.&lt;BR /&gt;&lt;BR /&gt;Going to scp the file to be modified from my target system to my local system.&lt;BR /&gt;&lt;BR /&gt;Create a backup copy on my local sytem&lt;BR /&gt;Modify file on my local system.&lt;BR /&gt;scp modified file back to target system.&lt;BR /&gt;Verify file permissions.&lt;BR /&gt;&lt;BR /&gt;So if I mess up I have an easy way out :)&lt;BR /&gt;&lt;BR /&gt;DOH!!</description>
      <pubDate>Tue, 15 Apr 2008 08:21:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103187#M91010</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-15T08:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103188#M91011</link>
      <description>&amp;gt;I want to create a method to leave with the admins here utilizing simple shell and ssh commands.&lt;BR /&gt;&lt;BR /&gt;Well you can use sed but you need to write the output to another file and then move back in place:&lt;BR /&gt;sed -e 's/DISABLETIME=[0-9][0-9]/DISABLETIME=60/' login &amp;gt; login.new; mv login.new login&lt;BR /&gt;&lt;BR /&gt;With a possible check to make sure you don't lose the whole file.</description>
      <pubDate>Tue, 15 Apr 2008 08:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103188#M91011</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-04-15T08:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103189#M91012</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;How could you get your perl statement to read a list of server names?&lt;BR /&gt;&lt;BR /&gt;I want to put all my server names into a text file.&lt;BR /&gt;&lt;BR /&gt;Loop through the text file.&lt;BR /&gt;Retrieve the login file and rename it login.servername. (via scp)&lt;BR /&gt;&lt;BR /&gt;Then run the "perl" command against the file login.servername.&lt;BR /&gt;&lt;BR /&gt;Then I'll end up with 2 files&lt;BR /&gt;1) login.servername with the new settings&lt;BR /&gt;2) login.servername.old which is a orig copy&lt;BR /&gt;&lt;BR /&gt;Have a good day!!&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 08:34:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103189#M91012</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-15T08:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103190#M91013</link>
      <description>Never mind  :)&lt;BR /&gt;...i'm just not thinking today&lt;BR /&gt;&lt;BR /&gt;I'll just use a variable in your perl string. The rest of the stuff is just easy loops around your command.&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Tue, 15 Apr 2008 08:40:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103190#M91013</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-15T08:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: updating  file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103191#M91014</link>
      <description>I ended up using James solution with a while loop etc.&lt;BR /&gt;&lt;BR /&gt;Sorry James I assigned you 7 points before I realized I was going to use your solution.&lt;BR /&gt;&lt;BR /&gt;wanted to give you 10 but couldn't go back and modify.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help</description>
      <pubDate>Tue, 15 Apr 2008 09:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/updating-file/m-p/5103191#M91014</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-15T09:07:13Z</dc:date>
    </item>
  </channel>
</rss>

