Sponsored Content
Top Forums Shell Programming and Scripting Please help me to figure out the logic for this problem Post 302392389 by tonijel on Thursday 4th of February 2010 09:17:52 AM
Old 02-04-2010
thanks , but it's not working : (
look , this is a copy-paste of what i've did ,
note that directories that are in the /u02/oradata/arch/flash/RING10/backupset , are not empty, so i guess some output of the ls command is
from the content of those directories:

Code:
[oracle@dell backupset]$ pwd
/u02/oradata/arch/flash/RING10/backupset
[oracle@dell backupset]$ ls -l
total 36
-rw-r--r--  1 oracle oinstall 6407 Jan 29 07:15 2010_01_29.log
-rw-r--r--  1 oracle oinstall 4102 Feb  2 07:15 2010_02_02.log
drwxr-x---  2 oracle oinstall 4096 Feb  4 14:02 2010_02_03
-rw-r--r--  1 oracle oinstall 3923 Feb  3 07:15 2010_02_03.log
drwxr-x---  2 oracle oinstall 4096 Feb  4 14:01 2010_02_04
-rw-r--r--  1 oracle oinstall 4667 Feb  4 14:02 2010_02_04.log
[oracle@dell backupset]$
[oracle@dell backupset]$ find /u02/oradata/arch/flash/RING10/backupset -type f | awk -F[./] '$(NF-2)!=$(NF-1){system("ls " $(NF-1)"."$NF)}'
2010_02_02.log
2010_01_29.log
ls: o1_mf_annnn_TAG20100204T071355_5pnsf51k_.bkp: No such file or directory
ls: o1_mf_annnn_TAG20100204T140154_5pokb3k8_.bkp: No such file or directory
ls: o1_mf_nnndf_TAG20100204T070029_5pnrmxpp_.bkp: No such file or directory
ls: o1_mf_annnn_TAG20100204T070012_5pnrmfvd_.bkp: No such file or directory
ls: o1_mf_annnn_TAG20100204T134643_5pojfo2k_.bkp: No such file or directory
ls: o1_mf_nnndf_TAG20100204T134648_5pojfrlt_.bkp: No such file or directory
2010_02_04.log
2010_02_03.log
ls: o1_mf_annnn_TAG20100203T071451_5pl52w9m_.bkp: No such file or directory
ls: o1_mf_nnndf_TAG20100203T070044_5pl48fq1_.bkp: No such file or directory
[oracle@dell backupset]$

In this case, i would need to have deleted 2010_02_02.log and 2010_01_29.log , as they don't have their directory.
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with if logic

Hi there, In my shell program I have two if statements the first one checks that the date in yyyymm format is equal to a date from the parameter file in yyyymm format, and that the file and sends an appropiate email The second one checks that the date in yyyymm format is equal to a... (1 Reply)
Discussion started by: rjsha1
1 Replies

2. UNIX for Dummies Questions & Answers

if then else logic with while loop problem

Hi Friends, I have to do write a shell file based on one flag.If that flag value is 'N' then process look in $DATA are and the normal process continue.If vaule is 'P' then it check for the files in different location $CONV and move those file in $DATA area and rest of the process... (2 Replies)
Discussion started by: Param0073
2 Replies

3. Shell Programming and Scripting

Nawk if logic problem

nawk '{ fmt="%3s %22s %48s %35s %21s\n"; if ($3==$6 && $1=="STOPLOSS") { tpy="Successful Match"; jnme=$1; sts="File will be loaded"; cntrl=$3; audit=$6; printf (fmt, tpy,jnme,sts,cntrl,audit) >> "'${AUDIT_DATA_FILE}/${AUDIT36}'" }else if ($3!=$6 && $1=="STOPLOSS") { tpy="Mis-Match ";... (4 Replies)
Discussion started by: wawa
4 Replies

4. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies
PPI::Structure(3)					User Contributed Perl Documentation					 PPI::Structure(3)

NAME
PPI::Structure - The base class for Perl braced structures INHERITANCE
PPI::Structure isa PPI::Node isa PPI::Element DESCRIPTION
PPI::Structure is the root class for all Perl bracing structures. This covers all forms of " [ ... ] ", " { ... } ", and " ( ... ) " brace types, and includes cases where only one half of the pair exist. The class PPI::Structure itself is full abstract and no objects of that type should actually exist in the tree. Elements vs Children A PPI::Structure has an unusual existance. Unlike a PPI::Document or PPI::Statement, which both simply contain other elements, a structure both contains and consists of content. That is, the brace tokens are not considered to be "children" of the structure, but are part of it. In practice, this will mean that while the ->elements and ->tokens methods (and related) will return a list with the brace tokens at either end, the ->children method explicitly will not return the brace. STRUCTURE CLASSES
Excluding the transient PPI::Structure::Unknown that exists briefly inside the parser, there are eight types of structure. PPI::Structure::List This covers all round braces used for function arguments, in "foreach" loops, literal lists, and braces used for precedence-ordering purposes. PPI::Structure::For Although not used for the "foreach" loop list, this is used for the special case of the round-brace three-part semicolon-seperated "for" loop expression (the traditional C style for loop). PPI::Structure::Given This is for the expression being matched in switch statements. PPI::Structure::When This is for the matching expression in "when" statements. PPI::Structure::Condition This round-brace structure covers boolean conditional braces, such as for "if" and "while" blocks. PPI::Structure::Block This curly-brace and common structure is used for all form of code blocks. This includes those for "if", "do" and similar, as well as "grep", "map", "sort", "sub" and (labelled or anonymous) scoping blocks. PPI::Structure::Constructor This class covers brace structures used for the construction of anonymous "ARRAY" and "HASH" references. PPI::Structure::Subscript This class covers square-braces and curly-braces used after a -> pointer to access the subscript of an "ARRAY" or "HASH". METHODS
"PPI::Structure" itself has very few methods. Most of the time, you will be working with the more generic PPI::Element or PPI::Node methods, or one of the methods that are subclass-specific. start For lack of better terminology (like "open" and "close") that has not already in use for some other more important purpose, the two individual braces for the structure are known within PPI as the "start" and "finish" braces (at least for method purposes). The "start" method returns the start brace for the structure (i.e. the opening brace). Returns the brace as a PPI::Token::Structure or "undef" if the structure does not have a starting brace. Under normal parsing circumstances this should never occur, but may happen due to manipulation of the PDOM tree. finish The "finish" method returns the finish brace for the structure (i.e. the closing brace). Returns the brace as a PPI::Token::Structure or "undef" if the structure does not have a finishing brace. This can be quite common if the document is not complete (for example, from an editor where the user may be halfway through typeing a subroutine). braces The "braces" method is a utility method which returns the brace type, regardless of whether has both braces defined, or just the starting brace, or just the ending brace. Returns on of the three strings '[]', '{}', or '()', or "undef" on error (primarily not having a start brace, as mentioned above). complete The "complete" method is a convenience method that returns true if the both braces are defined for the structure, or false if only one brace is defined. Unlike the top level "complete" method which checks for completeness in depth, the structure complete method ONLY confirms completeness for the braces, and does not recurse downwards. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.3 2011-02-26 PPI::Structure(3)
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy