Sponsored Content
Full Discussion: File exists routine
Top Forums Shell Programming and Scripting File exists routine Post 302266799 by kamathg on Thursday 11th of December 2008 04:52:26 AM
Old 12-11-2008
Jim,

Thanks very much.

I modified the routine as below. I know not exactly to your recommendations. But why does it run into a infinite loop ? Please can you explain ?


HTML Code:
uncompress () {

PARFILE=/gbwaaposoa2q4/ora01/app/oracle/orajobs/metadata
cat ${PARFILE} | while read line
do
        TABNAME=`echo $line | awk '{print $1}'`
        PART=`echo $line | awk '{print $2}'`
        REF=`echo $line | awk '{print $3}'`

        echo "Table name is ${TABNAME}"
        echo "partition name is ${PART}"
        echo "Business ref is ${REF}"

        DMPFILE=${EXPDIR}/${TABNAME}_PRT_${PART}.dmp
        echo "exp dir is $EXPDIR "
        if [[ ! -f ${DMPFILE} && ! -f ${DMPFILE}.Z ]] ; then
                echoLog "Dump file ${DMPFILE} does not exist. "
                continue
        fi

        [ -f ${DMPFILE} ] && echoLog "${DMPFILE} already exists uncompressed"
        [ -f ${DMPFILE}.Z ] && uncompress ${DMPFILE}.Z  && echoLog "uncompressed ${DMPFILE}"

done
}
I was thinking that it should read one line at a time until the end of the file


Got this output

Table name is SOACOE_AUDIT
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
Table name is SOACOE_LOGGER_SUMMARY
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
09:44:23 /tmp/SOACOE_LOGGER_SUMMARY_PRT_24112008.dmp already exists uncompressed
Table name is SOACOE_AUDIT
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
Table name is SOACOE_LOGGER_SUMMARY
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
09:44:23 /tmp/SOACOE_LOGGER_SUMMARY_PRT_24112008.dmp already exists uncompressed
Table name is SOACOE_AUDIT
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
Table name is SOACOE_LOGGER_SUMMARY
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
09:44:23 /tmp/SOACOE_LOGGER_SUMMARY_PRT_24112008.dmp already exists uncompressed
Table name is SOACOE_AUDIT
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
Table name is SOACOE_LOGGER_SUMMARY
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
09:44:23 /tmp/SOACOE_LOGGER_SUMMARY_PRT_24112008.dmp already exists uncompressed
Table name is SOACOE_AUDIT
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp
Table name is SOACOE_LOGGER_SUMMARY
partition name is 24112008
Business ref is 'CoPeRSender_v1.2.0:SalesEntity_ID=160598319'
exp dir is /tmp

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check File Exists and compare to previous day file script

We have data files that are ftp'd every morning to a SUN server. The file names are exactly the same except for that each has the date included in its name. I have to write script to do 2 things: STEP 1) Verify that the file arrived in morning. STEP 2) Compare the file size of the current... (3 Replies)
Discussion started by: rbknisely
3 Replies

2. Shell Programming and Scripting

Need to write a script in UNIX to find a file if another file exists

So I have a lot of Java applications on my servers all having their own folder from the applications subdirectory. Now, I need to do the following. Search all the applications subdirectories for message.jar. If the message.jar file exists, I need to search the application directory for... (1 Reply)
Discussion started by: mmdawg
1 Replies

3. Shell Programming and Scripting

Grep pattern from different file and display if it exists in the required file

Hi, I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg. "this is the line1" "this is the line2" The yyy.txt with lot of lines. eg: "This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Discussion started by: abinash
3 Replies

4. Shell Programming and Scripting

Need help in writing a routine for sorting a CSV file

Hi, I have a CSV file in following manner: server1,env1,patch1 server1,env1,patch2 server1,env1,patch3 server1,env2,patch1 server1,env2,patch3 server2,env3,patch1 server2,env3,patch5 server2,env4,patch1 server3,env6,patch1 server3,env7,patch2 server3,env7,patch3 I want to... (6 Replies)
Discussion started by: avikaljain
6 Replies

5. Shell Programming and Scripting

Newbie.. Find if a file exists and open, if not create the desired file..

Hey all, I'm brand new to script writing, I'm wanting to make a script that will ask for a file and then retrieve that file if it exists, and if it doesn't exist, create the file with the desired name, and I'm completely stuck.. so far.. #! bin/bash echo "Enter desired file" read "$file" if ... (5 Replies)
Discussion started by: Byrang
5 Replies

6. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

7. Windows & DOS: Issues & Discussions

Script that, if file exists in Samba share, moves file to Unix server

I'm looking to do pretty much what the title says. I want a script that runs, it can run on Unix or Windows, doesn't matter, and searches a Samba shares for a .txt file. If the file exists, the script will move (or possibly copy) the file from the Samba share into a directory on our Unix... (3 Replies)
Discussion started by: twcostello
3 Replies

8. Shell Programming and Scripting

File exists, but cannot be opened.How to check- whether it could be opened to read when it exists

Hi #Testing for file existence if ; then echo 'SCHOOL data is available for processing' else echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING' : i wrote a script, where it begins by checking if file exists or not. If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies

9. Shell Programming and Scripting

Search if file exists for a file pattern stored in array

Hi experts, I have two arrays one has the file paths to be searched in , and the other has the files to be serached.For eg searchfile.dat will have abc303 xyz123 i have to search for files that could be abc303*.dat or for that matter any extension . abc303*.dat.gz The following code... (2 Replies)
Discussion started by: 100bees
2 Replies

10. UNIX for Beginners Questions & Answers

File exists or not

Dear All, I am facing a small issue in my code where in I am searching for a file in a directory and if found it sends me a message along with the time and filename. However if a file is not found based on the search pattern, the result which I am getting is all the files present in that... (7 Replies)
Discussion started by: grvk101
7 Replies
Business::PayPal::API::ReauthorizationRequest(3pm)	User Contributed Perl Documentation	Business::PayPal::API::ReauthorizationRequest(3pm)

NAME
Business::PayPal::API::ReauthorizationRequest - PayPal ReauthorizationRequest API SYNOPSIS
use Business::PayPal::API::ReauthorizationRequest; ## see Business::PayPal::API documentation for parameters my $pp = new Business::PayPal::API::ReauthorizationRequest ( ... ); my %response = $pp->DoReauthorizationRequest ( AuthorizationID => $transid, Amount => $amount, CurrencyID => $currencyID ); DESCRIPTION
Business::PayPal::API::ReauthorizationRequest implements PayPal's DoReauthorizationRequest API using SOAP::Lite to make direct API calls to PayPal's SOAP API server. It also implements support for testing via PayPal's sandbox. Please see Business::PayPal::API for details on using the PayPal sandbox. DoReauthorizationRequest Implements PayPal's DoReauthorizationRequest API call. Supported parameters include: AuthorizationID Amount currencyID (defaults to 'USD' if not supplied) as described in the PayPal "Web Services API Reference" document. The default currencyID setting is 'USD' if not otherwise specified. The DoReauthorization is not allowed before the three day grace period set for the original AuthorizeRequest. Returns a hash containing the results of the transaction. Example: my %resp = $pp->DoReauthorizationRequest ( AuthorizationID => $trans_id, Amount => '15.00', CurrencyID => 'USD' ); unless( $resp{Ack} !~ /Success/ ) { for my $error ( @{$response{Errors}} ) { warn "Error: " . $error->{LongMessage} . " "; } } ERROR HANDLING See the ERROR HANDLING section of Business::PayPal::API for information on handling errors. EXPORT None by default. SEE ALSO
<https://developer.paypal.com/en_US/pdf/PP_APIReference.pdf> AUTHOR
Danny Hembree <danny@dynamical.org> COPYRIGHT AND LICENSE
Copyright (C) 2006 by Danny Hembree This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2009-12-07 Business::PayPal::API::ReauthorizationRequest(3pm)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy