<?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: Shellscript help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620469#M38564</link>
    <description>Hai Deepak,,&lt;BR /&gt;&lt;BR /&gt;When i execute below one i am getting only "DAT" &amp;amp;"CDR" files... &lt;BR /&gt;#find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "_" | while read FILE ; do&lt;BR /&gt;&lt;BR /&gt;But when i execute the below in the script ,It display nothing!!!!!!!!!&lt;BR /&gt;#find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "${BACK_FILE_EXT}" | while read FILE ; do&lt;BR /&gt;&lt;BR /&gt;I dont want to hardcoded "_" or "X_" in the scripts..Every thing i should read from the parameter....&lt;BR /&gt;&lt;BR /&gt;Is it possible.....&lt;BR /&gt;&lt;BR /&gt;Raj</description>
    <pubDate>Tue, 27 Nov 2001 10:49:44 GMT</pubDate>
    <dc:creator>Rajkumar_3</dc:creator>
    <dc:date>2001-11-27T10:49:44Z</dc:date>
    <item>
      <title>Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620455#M38550</link>
      <description>Hai all,&lt;BR /&gt;&lt;BR /&gt;I am having some problem with the script.....&lt;BR /&gt;&lt;BR /&gt;I have attached the shell script with all the details.....&lt;BR /&gt;&lt;BR /&gt;This script is prepared by robin.....&lt;BR /&gt;&lt;BR /&gt;I need your help to solve this problem....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 27 Nov 2001 01:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620455#M38550</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T01:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620456#M38551</link>
      <description>Well, we can try to help if you tell us what problem you are facing.&lt;BR /&gt;&lt;BR /&gt;Is it the &lt;BR /&gt;|ARGS RM&lt;BR /&gt;that is causing the problem?&lt;BR /&gt;If so, you'll get an error:&lt;BR /&gt;"`|' is not expected."&lt;BR /&gt;Just delete that line and try again.&lt;BR /&gt;&lt;BR /&gt;Apologies if I have not understood your question.</description>
      <pubDate>Tue, 27 Nov 2001 02:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620456#M38551</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T02:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620457#M38552</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It looks to me like the following section of code is missing a 'do' keyword.&lt;BR /&gt;&lt;BR /&gt;find /home/rajkumar/J??/* -name "X_*" -mtime +3 | while read FILE ;&lt;BR /&gt;rm $FILE &amp;amp;&amp;amp; logger "$0 : $FILE deleted" &lt;BR /&gt;COUNT=$(expr $COUNT + 1) &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Rob</description>
      <pubDate>Tue, 27 Nov 2001 02:23:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620457#M38552</guid>
      <dc:creator>Rob Galloway_1</dc:creator>
      <dc:date>2001-11-27T02:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620458#M38553</link>
      <description>Hello,&lt;BR /&gt;...&lt;BR /&gt;exit 1 &lt;BR /&gt;fi &lt;BR /&gt;|ARGS RM&lt;BR /&gt;COUNT=0 &lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;what's the line with the | ? that could be the erring line...&lt;BR /&gt;could please elaborate more on what the script basically does? &lt;BR /&gt;d_b</description>
      <pubDate>Tue, 27 Nov 2001 02:23:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620458#M38553</guid>
      <dc:creator>Mary Ann Lipa</dc:creator>
      <dc:date>2001-11-27T02:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620459#M38554</link>
      <description>hai all&lt;BR /&gt;&lt;BR /&gt;Thank you for your replies...&lt;BR /&gt;&lt;BR /&gt;similar to this script I have attached the other script with all the details..&lt;BR /&gt;&lt;BR /&gt;Consider this is actual script...Thanking you....&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 27 Nov 2001 02:28:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620459#M38554</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T02:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620460#M38555</link>
      <description>First, your RETAIN_PEND is set to 5, not 3.&lt;BR /&gt;&lt;BR /&gt;Second, find will give you all teh "X_*.DAT" files as well, you can eleimiate them by changing&lt;BR /&gt;find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | while read FILE ; do&lt;BR /&gt;to&lt;BR /&gt;find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "X_" | while read FILE ; do</description>
      <pubDate>Tue, 27 Nov 2001 02:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620460#M38555</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T02:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620461#M38556</link>
      <description>Hai deepak,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply....&lt;BR /&gt;&lt;BR /&gt;We cannot hardcoded "X_" in the script..That "database.props" will updated by the user from some other application...Some times user many change the it to "Y_".If they change it to "Y_" ,internally this "database.props" will automatically update to "Y_".so at that time it will be a problem..So we have to avoid it by getting the value itself from the "database.props" file..Is it possible in that way????&lt;BR /&gt;&lt;BR /&gt;Raj...</description>
      <pubDate>Tue, 27 Nov 2001 03:08:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620461#M38556</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T03:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620462#M38557</link>
      <description>Sure.&lt;BR /&gt;You already have a BACK_FILE_EXT=X_ in your props file.&lt;BR /&gt;You can do this:&lt;BR /&gt;find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v ${BACK_FILE_EXT} | while read FILE ; do &lt;BR /&gt;&lt;BR /&gt;Remember that once you change BACK_FILE_EXT from X_ to Y_, all files with X_ will be deleted when you run this script. Maybe you should consider:&lt;BR /&gt;find $DIR -name *${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "_" | while read FILE ; do</description>
      <pubDate>Tue, 27 Nov 2001 03:26:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620462#M38557</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T03:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620463#M38558</link>
      <description>hi deepak,&lt;BR /&gt;&lt;BR /&gt;When i placed | grep -v {BACK_FILE_EXT} &lt;BR /&gt;I am facing the error..&lt;BR /&gt;&lt;BR /&gt;and When i replaced with&lt;BR /&gt;| grep -v "_" it is displaying  the DAT files along with CDR files also....&lt;BR /&gt;&lt;BR /&gt;any solution please..&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 27 Nov 2001 04:19:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620463#M38558</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T04:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620464#M38559</link>
      <description>I hope you are not forgetting the $ in &lt;BR /&gt;" grep -v ${BACK_FILE_EXT} "&lt;BR /&gt;&lt;BR /&gt;find is working fine here in eliminating the cdr files.&lt;BR /&gt;I dont know whats going wrong on your end, but you can try this:&lt;BR /&gt;find $DIR -name *${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "_" | grep -v "CDR" | while read FILE ; do</description>
      <pubDate>Tue, 27 Nov 2001 04:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620464#M38559</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T04:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620465#M38560</link>
      <description>Hai Deepak,&lt;BR /&gt;&lt;BR /&gt;If i placed like this &lt;BR /&gt;1)|"grep -v ${BACK_FILE_EXT}"&lt;BR /&gt;2)|"grep -v $ "_""&lt;BR /&gt;&lt;BR /&gt;If i placed like this |grep -v "_"  i am getting CDR files as well as DAT files only....but "X_" are not displaying...&lt;BR /&gt;&lt;BR /&gt;Any solution ???&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 27 Nov 2001 05:32:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620465#M38560</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T05:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620466#M38561</link>
      <description>OK, lets start again..&lt;BR /&gt;you've got file*.DAT, X_file*.DAT and file*.CDR.&lt;BR /&gt;Now, which of these do you want to delete if they are older than 3 days?</description>
      <pubDate>Tue, 27 Nov 2001 06:01:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620466#M38561</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T06:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620467#M38562</link>
      <description>hi deepak,&lt;BR /&gt;&lt;BR /&gt;The script is attached again...&lt;BR /&gt;&lt;BR /&gt;In the "database.props" file i am having only "FILE_NAME=DAT" extension and "RETAIN_PEND=&amp;lt;3 or 4 days&amp;gt;&lt;BR /&gt;so i if execute the script it should collect only "DAT" extension files that were not starting with "X_&amp;lt;....&amp;gt;.DAT" and it should be deleted from the value specified in the "RETAIN_PEND" parameter........&lt;BR /&gt;&lt;BR /&gt;Other than that we should not delete all the files like "&lt;FILENAME....&gt;.DAT" &amp;amp; "&lt;FILENAME...&gt;.CDR" and the files starting with "X_&lt;FILENAME..&gt;.DAT".&lt;BR /&gt;&lt;BR /&gt;The files &lt;FILENAME...&gt;.DAT only should be deleted upon the RETAIN_PEND value....&lt;BR /&gt;&lt;BR /&gt;Please revert back to me if my explanation is wrong......&lt;BR /&gt;&lt;BR /&gt;RA&lt;/FILENAME...&gt;&lt;/FILENAME..&gt;&lt;/FILENAME...&gt;&lt;/FILENAME....&gt;</description>
      <pubDate>Tue, 27 Nov 2001 06:47:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620467#M38562</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T06:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620468#M38563</link>
      <description>find . -name "*DAT" -mtime +3 &lt;BR /&gt;will give you &lt;FILE&gt;.DAT and X_&lt;FILE&gt;.DAT&lt;BR /&gt;&lt;BR /&gt;find . -name "*DAT" -mtime +3 | grep -v "_"&lt;BR /&gt;will give you &lt;FILE&gt;.DAT&lt;BR /&gt;&lt;BR /&gt;Please try this. I don't see how you can be getting .CDR files.&lt;/FILE&gt;&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 27 Nov 2001 09:40:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620468#M38563</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T09:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620469#M38564</link>
      <description>Hai Deepak,,&lt;BR /&gt;&lt;BR /&gt;When i execute below one i am getting only "DAT" &amp;amp;"CDR" files... &lt;BR /&gt;#find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "_" | while read FILE ; do&lt;BR /&gt;&lt;BR /&gt;But when i execute the below in the script ,It display nothing!!!!!!!!!&lt;BR /&gt;#find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "${BACK_FILE_EXT}" | while read FILE ; do&lt;BR /&gt;&lt;BR /&gt;I dont want to hardcoded "_" or "X_" in the scripts..Every thing i should read from the parameter....&lt;BR /&gt;&lt;BR /&gt;Is it possible.....&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 27 Nov 2001 10:49:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620469#M38564</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T10:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620470#M38565</link>
      <description>Looks like your variables $FILE_NAME and $BACK_FILE_EXT are not set correctly.&lt;BR /&gt;Can you echo them and check?</description>
      <pubDate>Tue, 27 Nov 2001 10:52:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620470#M38565</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T10:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620471#M38566</link>
      <description>Hai &lt;BR /&gt;&lt;BR /&gt;When i execute this below script,Its displaying null;&lt;BR /&gt;&lt;BR /&gt;#################&lt;BR /&gt;export CONFIG_DIR=/home/rajkumar/house/input&lt;BR /&gt;export PROPERTY_FILE=database.props&lt;BR /&gt;&lt;BR /&gt;gw=$CONFIG_DIR/$PROPERTY_FILE&lt;BR /&gt;echo $gw&lt;BR /&gt;set | grep BAC_ $gw | cut -d= -f2 | while read DIR ; do&lt;BR /&gt;&lt;BR /&gt;if [ ! -d "$DIR" ] ; then&lt;BR /&gt;logger "$0: directory, $DIR not found."&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;COUNT=0&lt;BR /&gt;&lt;BR /&gt;find $DIR -name "*${FILE_NAME}" -mtime +${RETAIN_PEND} | grep -v "$BACK_FILE_EXT*" | while read FILE ; do&lt;BR /&gt;echo $FILE_NAME&lt;BR /&gt;echo $RETAIN_PEND&lt;BR /&gt;echo $BACK_FILE_EXT&lt;BR /&gt;#rm $FILE &amp;amp;&amp;amp; logger "$0: file  $FILE deleted."&lt;BR /&gt;COUNT=$(expr $COUNT + 1)&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;if [ "$COUNT" -gt 0 ] ; then&lt;BR /&gt;logger "$0: for directory $DIR, $COUNT file(s) removed."&lt;BR /&gt;else&lt;BR /&gt;logger "$0: for directory $DIR, no matching files found."&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;exit 0&lt;BR /&gt;####################################</description>
      <pubDate>Tue, 27 Nov 2001 11:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620471#M38566</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-11-27T11:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620472#M38567</link>
      <description>'set -x' at the start of the script, track the usage of variables and see where the break in logic is occuring.&lt;BR /&gt;&lt;BR /&gt;Share and enjoy! Ian</description>
      <pubDate>Tue, 27 Nov 2001 11:42:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620472#M38567</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2001-11-27T11:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620473#M38568</link>
      <description>OK, you need to do two thigs.&lt;BR /&gt;First, decide whether PROPERTY_FILE should be PROPERTY.PROPS or database.props.&lt;BR /&gt;Second, source the property file in your script like so:&lt;BR /&gt;-------------&lt;BR /&gt;gw=$CONFIG_DIR/$PROPERTY_FILE&lt;BR /&gt;. gw&lt;BR /&gt;-------------&lt;BR /&gt;&lt;BR /&gt;If, after doing this, your echos are still null, you may need to export the values in your properties file.&lt;BR /&gt;That is, instead of&lt;BR /&gt;FILE_NAME=DAT&lt;BR /&gt;you'll have to do a &lt;BR /&gt;export FILE_NAME=DAT&lt;BR /&gt;&lt;BR /&gt;Hope this helps.</description>
      <pubDate>Tue, 27 Nov 2001 13:57:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620473#M38568</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-27T13:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shellscript help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620474#M38569</link>
      <description>Hi deepak,&lt;BR /&gt;&lt;BR /&gt;Still the same problem occuring....&lt;BR /&gt;&lt;BR /&gt;Thank you all for your help..&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 04 Dec 2001 12:53:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shellscript-help-needed/m-p/2620474#M38569</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-12-04T12:53:29Z</dc:date>
    </item>
  </channel>
</rss>

