<?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 With parameter in Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538401#M915583</link>
    <description>Hi again Steven,&lt;BR /&gt;&lt;BR /&gt;I think this will fix you, we need to eat the spaces:&lt;BR /&gt;&lt;BR /&gt;mo=`date '+%b' | tr -d " "`&lt;BR /&gt;da=`date '+%e' | tr -d " "`&lt;BR /&gt;ccc="${mo} ${da}"&lt;BR /&gt;&lt;BR /&gt;Put that in your script. I am curious why you only care about 02 hours.&lt;BR /&gt;&lt;BR /&gt;Have fun, Clay&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Jun 2001 19:01:37 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-06-08T19:01:37Z</dc:date>
    <item>
      <title>Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538389#M915571</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I need some help from script export for parameter use.   I have a script to get date and count of email number to send out to put into message.    The codes:&lt;BR /&gt;&lt;BR /&gt;------------&lt;BR /&gt;bbb=`date`&lt;BR /&gt;ccc=`date '+%b %e'`&lt;BR /&gt;ddd=`grep ipaddress syslog.log | grep -c "$ccc  02:"`&lt;BR /&gt;&lt;BR /&gt;echo "Hello, " &amp;gt;&amp;gt;mesg&lt;BR /&gt;echo "We have sent $ddd email messages on $bbb." &amp;gt;&amp;gt; mesg&lt;BR /&gt;---------------------------&lt;BR /&gt;grep -c "$ccc  02:" is not working.   Put in the first part of line is the same.&lt;BR /&gt;&lt;BR /&gt;I try "sed -n /$ccc 02:/p' filename", not working.  (Supposed I have a file created by&lt;BR /&gt;"grep ipaddress syslog &amp;gt; filename" first.&lt;BR /&gt;&lt;BR /&gt;I don't know why the parameter can not work this way.&lt;BR /&gt;&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot,&lt;BR /&gt;&lt;BR /&gt;Steven &lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 14:41:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538389#M915571</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T14:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538390#M915572</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;I see nothing glaringly obvious. Can you attach&lt;BR /&gt;a small piece of your logfile. You may be having problems matching &lt;TAB&gt;'s.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;&lt;/TAB&gt;</description>
      <pubDate>Fri, 08 Jun 2001 15:18:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538390#M915572</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-08T15:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538391#M915573</link>
      <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;I'm with Clay.  I don't see anything obviously wrong.  One thought, however: are you sure that you have IPaddresses and not DNS names in syslog?&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 08 Jun 2001 15:31:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538391#M915573</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-08T15:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538392#M915574</link>
      <description>Hi Steven&lt;BR /&gt;&lt;BR /&gt;First just try&lt;BR /&gt;&lt;BR /&gt;grep ipaddress syslog.log , it chould give you some output , incase there is no outpput then you can pipe that out . I dont thionk anythin else looks wrong.&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 15:51:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538392#M915574</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2001-06-08T15:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538393#M915575</link>
      <description>Thank you for all the help.    I should have made it clearer --  it is just not getting the result of what I get, but the code itself runs.&lt;BR /&gt;&lt;BR /&gt;E.g. on the code:&lt;BR /&gt;-----------------------&lt;BR /&gt;ccc=`date '+%b %e'` &lt;BR /&gt;ddd=`grep ipaddress syslog.log | grep -c "$ccc 02:"` &lt;BR /&gt;-----------------------&lt;BR /&gt;I should have 700 counts today, but I get 800 counts instead including 100 counts from yesterday.  So the 2nd grep filter is not working, though it lets condition through.   Put it in the first grep place resulting the same.&lt;BR /&gt;&lt;BR /&gt;That's what I would like to see the parameter $ccc working.&lt;BR /&gt;&lt;BR /&gt;Can you help please?&lt;BR /&gt;&lt;BR /&gt;Steven&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 16:49:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538393#M915575</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T16:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538394#M915576</link>
      <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;Would you post your syslog and the *values* of the interpreted variables you are using?&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 08 Jun 2001 17:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538394#M915576</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-08T17:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538395#M915577</link>
      <description>Just for the heck of it try the following changes&lt;BR /&gt;&lt;BR /&gt;ccc=`/bin/date '+%b %e'` &lt;BR /&gt;ddd=`grep ipaddress syslog.log | grep -c "${ccc} 02:"` &lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 17:08:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538395#M915577</guid>
      <dc:creator>Ken Martin_1</dc:creator>
      <dc:date>2001-06-08T17:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538396#M915578</link>
      <description>Hi Steven, &lt;BR /&gt;&lt;BR /&gt;Again nothing obvious; posting your logfile&lt;BR /&gt;(or at least a portion of it exhibiting the problem) will really help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Fri, 08 Jun 2001 17:10:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538396#M915578</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-08T17:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538397#M915579</link>
      <description>I could only get 0 count if I try "${ccc} 02", same as any other ways.&lt;BR /&gt;&lt;BR /&gt;I would post some log files for reference:&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Jun  8 02:17:24 6C:IRIS sendmail[13277]: CAA13277: from=&lt;REGISTRY&gt;, size=1023, class=0, pri=31023, nrcpts=1, msgid=&amp;lt;200106080617.CAA13277@mai&lt;BR /&gt;l.appp.com&amp;gt;, proto=ESMTP, relay=exchs [111.222.333.444]&lt;BR /&gt;&lt;BR /&gt;Jun  8 02:17:24 6C:IRIS sendmail[13283]: CAA13283: from=&lt;REGISTRY&gt;, size=1038, class=0, pri=31038, nrcpts=1, msgid=&amp;lt;200106080617.CAA13283@mai&lt;BR /&gt;l.appp.com&amp;gt;, proto=ESMTP, relay=exchs [111.222.333.444]&lt;BR /&gt;------------------------------------------&lt;BR /&gt;&lt;BR /&gt;There is some problem on website for me to offer points for each who are so helpful.  Will do.&lt;/REGISTRY&gt;&lt;/REGISTRY&gt;</description>
      <pubDate>Fri, 08 Jun 2001 17:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538397#M915579</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T17:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538398#M915580</link>
      <description>I am looking at my syslog and I notice that in the date with single digit days there are 2 spaces between the month and day so it looks like "Jun&lt;SPACE&gt;&lt;SPACE&gt;7&lt;SPACE&gt;time".  Could the additional space be part of your problem?&lt;BR /&gt;&lt;BR /&gt;I'm grasping at straws here.&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;</description>
      <pubDate>Fri, 08 Jun 2001 18:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538398#M915580</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-06-08T18:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538399#M915581</link>
      <description>Patric,&lt;BR /&gt;&lt;BR /&gt;I notice the space issue.   If I use "grep -c "Jun  8" syslog", I have no problem.   Is it a matter of parameterfailing to work?&lt;BR /&gt;&lt;BR /&gt;If I use "ddd=grep date|grep -c ipaddress syslog", I get all 800 counts.   It tells me that the date part is problematic.</description>
      <pubDate>Fri, 08 Jun 2001 18:36:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538399#M915581</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T18:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538400#M915582</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I don't think the &lt;SPACE&gt; is the problem since Steven is quoting his variables.  Consider this:&lt;BR /&gt;&lt;BR /&gt;# X=`date`&lt;BR /&gt;# echo $X&lt;BR /&gt;# echo "$X"&lt;BR /&gt;&lt;BR /&gt;This is normal, expected shell behavior.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/SPACE&gt;</description>
      <pubDate>Fri, 08 Jun 2001 19:00:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538400#M915582</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-08T19:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538401#M915583</link>
      <description>Hi again Steven,&lt;BR /&gt;&lt;BR /&gt;I think this will fix you, we need to eat the spaces:&lt;BR /&gt;&lt;BR /&gt;mo=`date '+%b' | tr -d " "`&lt;BR /&gt;da=`date '+%e' | tr -d " "`&lt;BR /&gt;ccc="${mo} ${da}"&lt;BR /&gt;&lt;BR /&gt;Put that in your script. I am curious why you only care about 02 hours.&lt;BR /&gt;&lt;BR /&gt;Have fun, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 19:01:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538401#M915583</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-08T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538402#M915584</link>
      <description>The space should not be the issue, as shown as follows:&lt;BR /&gt;&lt;BR /&gt;-------------------&lt;BR /&gt;IRIS 50# date '+%b %e'&lt;BR /&gt;Jun  8&lt;BR /&gt;&lt;BR /&gt;IRIS 51# date&lt;BR /&gt;Fri Jun  8 16:12:43 EDT 2001&lt;BR /&gt;----------------------&lt;BR /&gt;&lt;BR /&gt;Both "Jun  8" have proper space in this system.&lt;BR /&gt;&lt;BR /&gt;Any more help?</description>
      <pubDate>Fri, 08 Jun 2001 19:20:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538402#M915584</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T19:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538403#M915585</link>
      <description>I test the code in Linux and find it basically working.  I use:&lt;BR /&gt;&lt;BR /&gt;grep ipaddress|grep -c "Jun  8" syslog&lt;BR /&gt;&lt;BR /&gt;and I get the correct count.&lt;BR /&gt;&lt;BR /&gt;While I do not have confidence in this unix shell I am working with, can someone think of other editor that might work?&lt;BR /&gt;&lt;BR /&gt;I know this works:&lt;BR /&gt;sed -n '/Jun  8 02:/p' syslog|wc -l&lt;BR /&gt;&lt;BR /&gt;but I feel parameter for "Jun  8" is hard to accept.   &lt;BR /&gt;&lt;BR /&gt;Someone knows more about sed please?</description>
      <pubDate>Fri, 08 Jun 2001 20:22:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538403#M915585</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2001-06-08T20:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help With parameter in Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538404#M915586</link>
      <description>Hi Steven, &lt;BR /&gt;&lt;BR /&gt;Your problem is that you are going to have to build the sed string 'on the fly'. I'm very  puzzled by this, since %e always prints 2 characters.&lt;BR /&gt;&lt;BR /&gt;Anyway if you want to use sed, do this:&lt;BR /&gt;&lt;BR /&gt;mo=`date '+%b' | tr -d " "` &lt;BR /&gt;da=`date '+%e' | tr -d " "` &lt;BR /&gt;ccc="/${mo}[ ]*${da}[ ]*02:/p" &lt;BR /&gt;knt = `cat syslog | sed -n -e "${ccc}" | wc -l`&lt;BR /&gt;echo "${knt} entries found"&lt;BR /&gt;&lt;BR /&gt;The idea is we build the sed string. The '[ ]*'&lt;BR /&gt;matches any number of spaces.&lt;BR /&gt;&lt;BR /&gt;Try that, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jun 2001 20:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-parameter-in-script/m-p/2538404#M915586</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-08T20:54:48Z</dc:date>
    </item>
  </channel>
</rss>

