<?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: More Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713158#M61085</link>
    <description>Hi Greg,&lt;BR /&gt;If I understand correctly then you want to delete fax data older then 14 days and before you delete you want to save that to log file.&lt;BR /&gt;&lt;BR /&gt;faxstats -OUTBOUND -admin -all | grep ${UPTO} &amp;gt; fax.logfile&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;as Clay says delete it&lt;BR /&gt;faxstats -OUTBOUND -admin -all |sed "/${UPTO}/d" &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
    <pubDate>Mon, 29 Apr 2002 15:22:32 GMT</pubDate>
    <dc:creator>Sachin Patel</dc:creator>
    <dc:date>2002-04-29T15:22:32Z</dc:date>
    <item>
      <title>More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713153#M61080</link>
      <description>I'm trying to write a script that will purge a faxing database and I'm hung up on the way the shell interprets the following line:&lt;BR /&gt;&lt;BR /&gt;faxstats -OUTBOUND -admin -all |sed '/$UPTO/,\$d'&lt;BR /&gt;&lt;BR /&gt;where $UPTO is a date variable, i.e. "Apr 15"&lt;BR /&gt;&lt;BR /&gt;If I surround the command in echo "" it prints the correct command and information.  But, when I run it from a script I get the following error:&lt;BR /&gt;&lt;BR /&gt;sed: 0602-404 Function /$UPTO/,\$d cannot be parsed.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Greg&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 14:39:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713153#M61080</guid>
      <dc:creator>Greg Stark_1</dc:creator>
      <dc:date>2002-04-29T14:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713154#M61081</link>
      <description>Hi Greg:&lt;BR /&gt;&lt;BR /&gt;I'm not sure that I quite understand what you want to do but if all you want to do is delete all lines that have 'Apr 15' in them then this should do it:&lt;BR /&gt;&lt;BR /&gt;UPTO="Apr 15"&lt;BR /&gt;faxstats -OUTBOUND -admin -all |sed "/${UPTO}/d"&lt;BR /&gt;&lt;BR /&gt;Note the use of the double quotes to allow the varuable to be evaluated.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 14:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713154#M61081</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-04-29T14:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713155#M61082</link>
      <description>Hi Greg,&lt;BR /&gt;I thing you are trying to replace $UPTO by ",$d"&lt;BR /&gt;&lt;BR /&gt;example&lt;BR /&gt;# t="somethis apr 15"&lt;BR /&gt;# t1="apr 15"&lt;BR /&gt;&lt;BR /&gt;replace apr 15 by ttt&lt;BR /&gt;&lt;BR /&gt;# echo $t |sed "s/$t1/ttt/g"&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 15:07:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713155#M61082</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-29T15:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713156#M61083</link>
      <description>Perhaps I should give some more info.  The fax software can delete entries in the database up to a certain date.  I want to run this script each day and delete all entries older than 14 days (this is what you helped me with on Friday - caljd.sh).&lt;BR /&gt;&lt;BR /&gt;Before actually deleting the fax entries, I want to log which entries will be deleted.  To do this I am using the "faxstats -OUTBOUND -admin -all" command to do a listing of the current entries in the database and sed to parse out the entries that are before the given $UPTO date.  The faxstats/sed command works from the command line.  It also seems to be loading the correct date variable when I echo the command in the script.&lt;BR /&gt;&lt;BR /&gt;I have attached the script so far as well as a portion of the output of faxstats -OUTBOUND -admin -all.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Greg</description>
      <pubDate>Mon, 29 Apr 2002 15:07:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713156#M61083</guid>
      <dc:creator>Greg Stark_1</dc:creator>
      <dc:date>2002-04-29T15:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713157#M61084</link>
      <description>Okay Greg, you could use grep to do this but you are wise to use sed to both print the pattern AND to do the deletion - that way you know that both operations zig or zag in unison.&lt;BR /&gt;&lt;BR /&gt;To print the lines to be deleted:&lt;BR /&gt;&lt;BR /&gt;UPTO="Apr 15" &lt;BR /&gt;faxstats -OUTBOUND -admin -all |sed -n "/${UPTO}/p"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Note the use of the -n option to suppress the default output.  &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 15:21:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713157#M61084</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-04-29T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713158#M61085</link>
      <description>Hi Greg,&lt;BR /&gt;If I understand correctly then you want to delete fax data older then 14 days and before you delete you want to save that to log file.&lt;BR /&gt;&lt;BR /&gt;faxstats -OUTBOUND -admin -all | grep ${UPTO} &amp;gt; fax.logfile&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;as Clay says delete it&lt;BR /&gt;faxstats -OUTBOUND -admin -all |sed "/${UPTO}/d" &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 15:22:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713158#M61085</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-29T15:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713159#M61086</link>
      <description>Greg, &lt;BR /&gt;&lt;BR /&gt;shouldn't that work if you fed sed double quotes instead of single?  Single quotes force passing literal contents, whereas double quotes allow shell to expand expressions, which is what you want, no?&lt;BR /&gt;&lt;BR /&gt;Clay -- school me if I've got this wrong...&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Apr 2002 16:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713159#M61086</guid>
      <dc:creator>Mark Fenton</dc:creator>
      <dc:date>2002-04-29T16:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713160#M61087</link>
      <description>Hi Greg,&lt;BR /&gt;&lt;BR /&gt;this is a quoting problem:&lt;BR /&gt;&lt;BR /&gt;\  quotes one meta character, which follows directly&lt;BR /&gt;&lt;BR /&gt;'quoted_string' quotes EVERY meta character inside, the only thing not quoted is " ' " itself! No variable subsittution or command substitution inside of quoting! ( This is your problem.... )&lt;BR /&gt;&lt;BR /&gt;"quoted_string" --&amp;gt;&amp;gt;&amp;gt; some meta characters are quoted, but within quoting variable substitution and command substitution is done!&lt;BR /&gt;&lt;BR /&gt;So this should do it for you! Simply use "" instead of '' for quoting.&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Mon, 29 Apr 2002 17:00:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713160#M61087</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-04-29T17:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: More Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713161#M61088</link>
      <description>Thanks Mark and Peter!  That did it.  Clay, I'm sure if I would have explained it better, you would have known what I was getting at.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Greg</description>
      <pubDate>Mon, 29 Apr 2002 17:52:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/more-script-help/m-p/2713161#M61088</guid>
      <dc:creator>Greg Stark_1</dc:creator>
      <dc:date>2002-04-29T17:52:18Z</dc:date>
    </item>
  </channel>
</rss>

