<?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 Help with script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015296#M718757</link>
    <description>&lt;BR /&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;In the script attached the var USER contain no data, maybe its a problem while reading the data.txt.&lt;BR /&gt;Anybody can help ?</description>
    <pubDate>Fri, 04 Jul 2003 02:13:23 GMT</pubDate>
    <dc:creator>Ricardo Bassoi</dc:creator>
    <dc:date>2003-07-04T02:13:23Z</dc:date>
    <item>
      <title>Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015296#M718757</link>
      <description>&lt;BR /&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;In the script attached the var USER contain no data, maybe its a problem while reading the data.txt.&lt;BR /&gt;Anybody can help ?</description>
      <pubDate>Fri, 04 Jul 2003 02:13:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015296#M718757</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-07-04T02:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015297#M718758</link>
      <description>could you provide the contents of the file data.txt?</description>
      <pubDate>Fri, 04 Jul 2003 02:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015297#M718758</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-04T02:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015298#M718759</link>
      <description>Hi Ricardo&lt;BR /&gt;&lt;BR /&gt;Your syntax looks correct to me.  &lt;BR /&gt;What value is contained in the $USER_ASS variable prior to:&lt;BR /&gt;USER=`echo $USER_ASS|awk -F "-" '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;One thing that is possible is that the first field of the $USER_ASS has a "-". If this is the case you'll get nothing returned.&lt;BR /&gt;&lt;BR /&gt;Also check further up, what's in data.txt??&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2003 03:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015298#M718759</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T03:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015299#M718760</link>
      <description>&lt;BR /&gt;Hi, &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sorry !&lt;BR /&gt;&lt;BR /&gt;The data.txt contains:&lt;BR /&gt;&lt;BR /&gt;91838383;23/05/2003&lt;BR /&gt;91834383;22/07/2003&lt;BR /&gt;91838563;23/05/2003&lt;BR /&gt;91838383;03/09/2003&lt;BR /&gt;91838383;13/01/2003&lt;BR /&gt;34838383;23/05/2003&lt;BR /&gt;54838383;23/05/2003&lt;BR /&gt;91838381;25/12/2002&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2003 03:05:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015299#M718760</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-07-04T03:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015300#M718761</link>
      <description>&lt;BR /&gt;Sorry again,&lt;BR /&gt;&lt;BR /&gt;The correct is:&lt;BR /&gt;&lt;BR /&gt;91838383-23/05/2003 &lt;BR /&gt;91834383-22/07/2003 &lt;BR /&gt;91838563-23/05/2003 &lt;BR /&gt;91838383-03/09/2003 &lt;BR /&gt;91838383-13/01/2003 &lt;BR /&gt;34838383-23/05/2003 &lt;BR /&gt;54838383-23/05/2003 &lt;BR /&gt;91838381-25/12/2002</description>
      <pubDate>Fri, 04 Jul 2003 03:07:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015300#M718761</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-07-04T03:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015301#M718762</link>
      <description>The "while read DATA USER" line only sees one field in this file.&lt;BR /&gt;It reads everything into DATA variable, the USER_ASS is empty.&lt;BR /&gt;Hence when you run&lt;BR /&gt;USER=`echo $USER_ASS|awk -F "-" '{print $1}'`&lt;BR /&gt;the $USER_ASS Variable is empty.&lt;BR /&gt;&lt;BR /&gt;You need to insert a space before or after ";" in the data.txt file and it will work.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2003 03:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015301#M718762</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T03:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015302#M718763</link>
      <description>Sorry should have said a space before or after "-" (not ";") in the data.txt file.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Fri, 04 Jul 2003 03:14:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015302#M718763</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T03:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015303#M718764</link>
      <description>Hi Ricardo(again)&lt;BR /&gt;&lt;BR /&gt;Change the line &lt;BR /&gt;awk -F ";" '{printf "%-9s-%-10s\n",$1,$2}' temp.txt &amp;gt; data.txt&lt;BR /&gt;to&lt;BR /&gt;awk -F ";" '{print $1, $2}' temp.txt &amp;gt; data.txt&lt;BR /&gt;&lt;BR /&gt;This should fix your problem.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Fri, 04 Jul 2003 03:23:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015303#M718764</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T03:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015304#M718765</link>
      <description>modify&lt;BR /&gt;&lt;BR /&gt;cat data.txt | while read DATA USER_ASS&lt;BR /&gt;do&lt;BR /&gt;USER=`echo $USER_ASS|awk -F "-" '{print $1}'`&lt;BR /&gt;DATA_SISTEMA=`echo $DATA|awk -F "-" '{print $2}'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;to be:&lt;BR /&gt;&lt;BR /&gt;cat data.txt | while read DATA &lt;BR /&gt;do&lt;BR /&gt;USER=${DATA%%-*}&lt;BR /&gt;DATA_SISTEMA=${DATA#*-}</description>
      <pubDate>Fri, 04 Jul 2003 03:35:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015304#M718765</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-04T03:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015305#M718766</link>
      <description>Sorry for all the multiple posts - please zero point them all.&lt;BR /&gt;&lt;BR /&gt;Looked again at my previous post &amp;amp; realised you're using "-" as a field seperator, therefore the variable assignments for USER &amp;amp; DATA_SISTEMA do not need the '-F "-"' as part of the awk (white space is a default).&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Fri, 04 Jul 2003 03:49:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015305#M718766</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T03:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015306#M718767</link>
      <description>&lt;BR /&gt;Corn,&lt;BR /&gt;&lt;BR /&gt;How to remove the / in the DATA and do the compare ?&lt;BR /&gt;&lt;BR /&gt;Curtis,&lt;BR /&gt;&lt;BR /&gt;Can you explain:&lt;BR /&gt;&lt;BR /&gt;USER=${DATA%%-*} &lt;BR /&gt;DATA_SISTEMA=${DATA#*-} &lt;BR /&gt;&lt;BR /&gt;Tks</description>
      <pubDate>Fri, 04 Jul 2003 03:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015306#M718767</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-07-04T03:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015307#M718768</link>
      <description>Hi Ricardo&lt;BR /&gt;&lt;BR /&gt;No points please.  &lt;BR /&gt;Just a few ideas - I haven't tested any of this so might be wrong as before!!&lt;BR /&gt;I think you're talking about comparing the dates at the end of your script??&lt;BR /&gt;You can amend your script as:&lt;BR /&gt;&lt;BR /&gt;......&lt;BR /&gt;#---echo $DATA&lt;BR /&gt;DATA_ATUAL=`date +%Y%m%d`&lt;BR /&gt;DATA_SISTEMA=`echo $DATA_SISTEMA |awk -F/ '{print $3$2$1}'`&lt;BR /&gt;if [ $DATA_ATUAL -gt $DATA_SISTEMA]&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;No need for the lines:&lt;BR /&gt;DATA2=`date +%d/%m/%Y`&lt;BR /&gt;#---echo $DATA2&lt;BR /&gt;&lt;BR /&gt;Not sure if thats what you're after.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2003 04:29:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015307#M718768</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-04T04:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015308#M718769</link>
      <description>&lt;BR /&gt;Sorry Corn,&lt;BR /&gt;&lt;BR /&gt;But you deserves it !!!&lt;BR /&gt;&lt;BR /&gt;Tks</description>
      <pubDate>Fri, 04 Jul 2003 04:49:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015308#M718769</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-07-04T04:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015309#M718770</link>
      <description># input the whole line into the variable DATA&lt;BR /&gt;# &lt;BR /&gt;cat data.txt | while read DATA &lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;# this is parameter expansion using substrings&lt;BR /&gt;#&lt;BR /&gt;# %% removes the large right pattern&lt;BR /&gt;# syntax is ${param%%pattern}&lt;BR /&gt;# example&lt;BR /&gt;# x=foo/fun/bar&lt;BR /&gt;# print ${x%%/*}&lt;BR /&gt;# foo&lt;BR /&gt;#&lt;BR /&gt;# # removes the small left pattern&lt;BR /&gt;# syntax is ${param#pattern}&lt;BR /&gt;# example&lt;BR /&gt;# cd $HOME/src/cmd&lt;BR /&gt;# print ${PWD#$HOME/}&lt;BR /&gt;# src/cmd&lt;BR /&gt;#&lt;BR /&gt;# USER = DATA with all characters removed from the right up to and including the first -, i.e. everything before the first -&lt;BR /&gt;#&lt;BR /&gt;# DATA_SISTEMA = DATA with all characters removed from the left up to and including the first -, i.e. everything after the first -&lt;BR /&gt;#&lt;BR /&gt;# &lt;BR /&gt;USER=${DATA%%-*} &lt;BR /&gt;DATA_SISTEMA=${DATA#*-}</description>
      <pubDate>Fri, 04 Jul 2003 05:43:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/3015309#M718770</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-04T05:43:07Z</dc:date>
    </item>
  </channel>
</rss>

