Sponsored Content
Top Forums Shell Programming and Scripting Check file size and remove files Post 302071165 by blowtorch on Thursday 13th of April 2006 01:53:34 AM
Old 04-13-2006
Something like this?
Code:
cd /directory/where/files/are/present
if [ -s EdwSlsRej -o -s EdwTndrRej ]; then
echo rm EdwPost EdwSls EdwTndr EdwTrxn
elif [ ! -s EdwSlsRej -a ! -s EdwTndrRej ]; then
echo rm EdwSlsRej EdwTndrRej
fi

This will delete the EdwPost EdwSls EdwTndr EdwTrxn files if any of EdwSlsRej or EdwTndrRej files are larger than 0 bytes, but delete EdwSlsRej and EdwTndrRej files if they *both* are 0 bytes. No action is taken in any other case.

N.B. Just remove the echo commands to actually delete the files.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove files with 0 size, space and double qoute

os=hpux11 shell=ksh some jokers had written thousands of empty files into my $HOME. and the files are named inconsistently that some of them include space and double qoutes. all those files are of 0 size (when i did ls -al it told me so). the naming paterns are like e.g of ls -al output: ... (3 Replies)
Discussion started by: nongrad
3 Replies

2. Shell Programming and Scripting

How to check if 3 files have same size in directory

I need to determine if any three files have the same file size in a specified directly? I have got as far as listing the file sizes but where to go from here? ls -al |sort -n -r +4 | awq '{print $5}' Thanks in anticipation (5 Replies)
Discussion started by: oggle
5 Replies

3. UNIX for Dummies Questions & Answers

Check the size of files

Hi, I need to put a script working to see in a directory with logs if exists file or files with size more than 12Mb. If exists it shoul send mail. Can anyone help me? thanks (3 Replies)
Discussion started by: osramos
3 Replies

4. Shell Programming and Scripting

Check for file size is zero or not.

I have following script on AIX/KSH if ] ; then echo "filename exists and is > 0 bytes" else echo "filename does not exist or is zero length" fi It is not working. What is wrong here??? (3 Replies)
Discussion started by: Hangman2
3 Replies

5. Shell Programming and Scripting

To remove files with 0 File Size

Dear All, I want to remove files having size of (0) that are generated once script is completed. Here is the code but i m not sure about /usr/bin do i need to write /usr/bin, or the path of my script /tmp/test please find below the script logic #!/usr/bin/ksh for i... (9 Replies)
Discussion started by: jojo123
9 Replies

6. Shell Programming and Scripting

To remove the files in MB size

Hi, Using the shell script, I need to remove the files that are larger than 50 MB in size. I am not good in shell scripting. (1 Reply)
Discussion started by: gsiva
1 Replies

7. Shell Programming and Scripting

check the file size

if ; then cp /tmp/testfolder/*.* ~/new/logs/ else echo "No files today" exit fi The problem is this doen't work when there is more than 1 file. Please tell me how to take the latest file and check the size of the file in a directory (1 Reply)
Discussion started by: sandy1028
1 Replies

8. Shell Programming and Scripting

Check a file size

I'm doing a script thats check if mylogfile.log is bigger then 5000 but i dont know how to write it. thanks in avance. (6 Replies)
Discussion started by: Froob
6 Replies

9. Shell Programming and Scripting

File size check

I am trying to check whether two files are empty or not using below if condition but its checking for only one file if ] Again I tried if && ] Need your assistance (2 Replies)
Discussion started by: Aditya_001
2 Replies

10. Shell Programming and Scripting

How to check total files size in hdfs directory?

Is there a way to calculate the total file size of HDFS file directory in GB or MB? I dont want to use du/df command. Without that is there a way HDFS Directory - /test/my_dir (1 Reply)
Discussion started by: rohit_shinez
1 Replies
asadmin-delete-jndi-resource(1AS)				   User Commands				 asadmin-delete-jndi-resource(1AS)

NAME
asadmin-delete-jndi-resource, delete-jndi-resource - removes the JNDI resource SYNOPSIS
delete-jndi-resource --user admin_user[--password admin_password][--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] jndi_name Removes the JNDI resource. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. OPERANDS
jndi_name name of the JNDI resource to be deleted. Example 1: Using the delete-jndi-resource command asadmin> delete-jndi-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 sample_jndi_resource Command delete-jndi-resource executed successfully Where: sample_jndi_resource is the JNDI resource to be deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jndi-resource(1AS), asadmin-list-jndi-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-jndi-resource(1AS)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy