<?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: Help in automatically removing lines. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592393#M679693</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I am confused, :)&lt;BR /&gt;&lt;BR /&gt;As I said in your thread, and as I and others said in the thread Horia referenced, persisting in trying to add or subtract an hour offset to TZ is not always going to work!&lt;BR /&gt;&lt;BR /&gt;The tiny Perl snippet to obtain yesterday's or tomorrow's date (or virtually any date in the past or future by subtracting or adding some number of Epoch seconds) is guaranteed to yield accurate date and time offsets.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 11 Mar 2010 12:33:46 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-03-11T12:33:46Z</dc:date>
    <item>
      <title>Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592371#M679671</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i just want to remove the lines in a file from a particular text to end of the file.&lt;BR /&gt;&lt;BR /&gt;eg: consider a file "test" in that&lt;BR /&gt;line no 1 &lt;BR /&gt;line no 2&lt;BR /&gt;line no 3&lt;BR /&gt;#new lines&lt;BR /&gt;Word1 &lt;BR /&gt;word2&lt;BR /&gt;&lt;BR /&gt;my requirement is to remove the lines after "#new lines"&lt;BR /&gt;&lt;BR /&gt;Please suggest me on the same.</description>
      <pubDate>Mon, 01 Mar 2010 11:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592371#M679671</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-01T11:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592372#M679672</link>
      <description>hi &lt;BR /&gt;&lt;BR /&gt;Forget to mention :&lt;BR /&gt;&lt;BR /&gt;I need one script to automatically read and delete the kines after the particular text.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Mon, 01 Mar 2010 11:26:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592372#M679672</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-01T11:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592373#M679673</link>
      <description>&lt;!--!*#--&gt;awk '&lt;BR /&gt;/#new lines/ {&lt;BR /&gt;   print $0&lt;BR /&gt;   exit&lt;BR /&gt;}&lt;BR /&gt;{print $0}' file &amp;gt; file.new</description>
      <pubDate>Mon, 01 Mar 2010 11:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592373#M679673</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-01T11:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592374#M679674</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;Thanks for your response.&lt;BR /&gt;Can you brief what this script will do ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Mar 2010 12:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592374#M679674</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-01T12:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592375#M679675</link>
      <description>&amp;gt;Can you brief what this script will do?&lt;BR /&gt;&lt;BR /&gt;It will print lines from file to file.new.&lt;BR /&gt;When it sees a line with "#new lines", it will print that, then exit.</description>
      <pubDate>Mon, 01 Mar 2010 12:16:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592375#M679675</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-01T12:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592376#M679676</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way is:&lt;BR /&gt;&lt;BR /&gt;# sed -n '1,/^#new/p' file&lt;BR /&gt;&lt;BR /&gt;This begins by turning off any printing (the '-n').  If the line number is within the inclusive range of line number one (1) through a line that begins (^) with the string "new", then print the line.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 01 Mar 2010 12:50:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592376#M679676</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-01T12:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592377#M679677</link>
      <description>Hi &lt;BR /&gt;and inversed expression to JRF's sed:&lt;BR /&gt;&lt;BR /&gt;# sed '/new lines/,$d' test&lt;BR /&gt;&lt;BR /&gt;rgds&lt;BR /&gt;HGH</description>
      <pubDate>Mon, 01 Mar 2010 13:05:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592377#M679677</guid>
      <dc:creator>Hemmetter</dc:creator>
      <dc:date>2010-03-01T13:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592378#M679678</link>
      <description>hello,&lt;BR /&gt;in general to delete lines between START END:&lt;BR /&gt;sed -n'/^START/,/^END/d' file.in &amp;gt;file.out&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Tue, 02 Mar 2010 08:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592378#M679678</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2010-03-02T08:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592379#M679679</link>
      <description>Don't forget about that -n in the sed command.  It tells sed to suppress printing out unless you call for it.&lt;BR /&gt;&lt;BR /&gt;$ cat junk&lt;BR /&gt;one&lt;BR /&gt;two&lt;BR /&gt;three&lt;BR /&gt;START&lt;BR /&gt;four&lt;BR /&gt;five&lt;BR /&gt;six&lt;BR /&gt;seven&lt;BR /&gt;END&lt;BR /&gt;eight&lt;BR /&gt;nine&lt;BR /&gt;ten&lt;BR /&gt;&lt;BR /&gt;$ cat junk | sed  '/^START/,/^END/d'&lt;BR /&gt;one&lt;BR /&gt;two&lt;BR /&gt;three&lt;BR /&gt;eight&lt;BR /&gt;nine&lt;BR /&gt;ten&lt;BR /&gt;&lt;BR /&gt;$ cat junk | sed -n '/^START/,/^END/p'&lt;BR /&gt;START&lt;BR /&gt;four&lt;BR /&gt;five&lt;BR /&gt;six&lt;BR /&gt;seven&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Mar 2010 13:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592379#M679679</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2010-03-02T13:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592380#M679680</link>
      <description>you can use :&lt;BR /&gt;echo "head -$(($(grep -n '#new lines' test | awk -F : '{print ($1)}') -1 )) test &amp;gt;&amp;gt; test2" |sh&lt;BR /&gt;&lt;BR /&gt;This will find the line number where pattern #new lines is , then subtract 1 from it and use head to put it in another file test2.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 02 Mar 2010 14:16:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592380#M679680</guid>
      <dc:creator>Siddhartha Sarkar</dc:creator>
      <dc:date>2010-03-02T14:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592381#M679681</link>
      <description>&amp;gt;Siddhartha: This will find the line number where pattern #new lines is&lt;BR /&gt;&lt;BR /&gt;And will also read the whole file, then the first part again.</description>
      <pubDate>Wed, 03 Mar 2010 09:58:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592381#M679681</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-03T09:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592382#M679682</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to print the previous day date.&lt;BR /&gt;Please let me know how can i achieve it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2010 08:43:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592382#M679682</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-08T08:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592383#M679683</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt; echo `(export TZ=XYZ+24; date "+%d/%m/%y")`&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Mon, 08 Mar 2010 08:49:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592383#M679683</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-03-08T08:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592384#M679684</link>
      <description>Hi Horia,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your response&lt;BR /&gt;&lt;BR /&gt;can you just brief what this command will do ?&lt;BR /&gt;&lt;BR /&gt;Also what will happen at the starting of month. say jan 1. In that case will it display the last year an last month date ?&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Mon, 08 Mar 2010 08:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592384#M679684</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-08T08:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592385#M679685</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Also what will happen at the starting of month. say jan 1. In that case will it display the last year an last month date ?&lt;BR /&gt;&lt;BR /&gt;Yes, it will work. Will work also on March, 1 showing February 28/29 and so...&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Mon, 08 Mar 2010 09:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592385#M679685</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-03-08T09:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592386#M679686</link>
      <description>Hi,&lt;BR /&gt;I want to customize the year part of the o/p.&lt;BR /&gt;&lt;BR /&gt;rt now its showing as 07/03/10 , iwant it in 07/03/2010.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 08 Mar 2010 09:08:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592386#M679686</guid>
      <dc:creator>Soul_1</dc:creator>
      <dc:date>2010-03-08T09:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592387#M679687</link>
      <description>&amp;gt;now its showing as 07/03/10 , iwant it in 07/03/2010.&lt;BR /&gt;&lt;BR /&gt;Just change %y with %Y&lt;BR /&gt;&lt;BR /&gt;man date should help.&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Mon, 08 Mar 2010 10:09:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592387#M679687</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-03-08T10:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592388#M679688</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I want to customize the year part of the o/p...its showing as 07/03/10 , i want it in 07/03/2010&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime "%02m/%02d/%Y",localtime(time-(60*60*24))'&lt;BR /&gt;&lt;BR /&gt;...will give you yesterday's date correctly, crossing year boundaries as necessary.&lt;BR /&gt;&lt;BR /&gt;You can change the format of the output just like you would using a simple 'date' command format.&lt;BR /&gt;&lt;BR /&gt;Do *not* be fooled by trying to manipulate your 'TZ' variable by adding or subtracting 24-hours.  This works correctly only for UTC (GMT) timezones.  Use Perl;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2010 12:46:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592388#M679688</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-08T12:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592389#M679689</link>
      <description>James: &amp;gt; This works correctly only for UTC (GMT) timezones&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can you please explain this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Tue, 09 Mar 2010 06:21:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592389#M679689</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-03-09T06:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help in automatically removing lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592390#M679690</link>
      <description>&amp;gt;Horia: Can you please explain this?&lt;BR /&gt;&lt;BR /&gt;The code in libc only expects to have valid timezones.  These are UTC +/- 12 hours.&lt;BR /&gt;&lt;BR /&gt;What you did was:&lt;BR /&gt;$ TZ=XYZ+24 date "+%d/%m/%y %Z"&lt;BR /&gt;08/03/10 XYZ&lt;BR /&gt;&lt;BR /&gt;This converts to UTC time and adds 24 hours.  What if there was a DST transition and you skip or lose a day?</description>
      <pubDate>Tue, 09 Mar 2010 09:18:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-in-automatically-removing-lines/m-p/4592390#M679690</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-09T09:18:28Z</dc:date>
    </item>
  </channel>
</rss>

