Sponsored Content
Top Forums Shell Programming and Scripting can you think of a better way? Post 15011 by Kelam_Magnus on Friday 8th of February 2002 02:16:14 PM
Old 02-08-2002
Your script looks good.

You need to close the `cat ... statement with another ` .
Also, depending on your Flavor of UNIX, you probably don't need the brackets and semicolons.

In your cat statement you can put the full path of the file that contains the columnar list of the files to be deleted. I would hope that this list shows the full path of each file to be deleted as well.

You can also use the "-i" option if you want to double check the deletion of the file, but it looks like you already want to get rid of all of these files.


Here is my variation of your script. Yours was good, but I like to see a logfile output with errors as well.

The 2> delete.error.log will record any exceptions to your script. That you can look at later. This is good especially for more complicated scripts.


for A in `cat filename`
do
echo $A "is being deleted now" >> delete.log
find . -name $A -exec rm {} \;
echo $A "has been deleted" >> delete.log 2> delete.error.log
done



Smilie
 
asadmin-delete-jdbc-resource(1AS)				   User Commands				 asadmin-delete-jdbc-resource(1AS)

NAME
asadmin-delete-jdbc-resource, delete-jdbc-resource - removes the JDBC resource SYNOPSIS
delete-jdbc-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 JDBC 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 JDBC resource to be deleted. Example 1: Using the delete-jdbc-resource command asadmin> delete-jdbc-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 sample_jdbc_resource Command delete-jdbc-resource executed successfully Where: sample_jdbc_resource is the resource that is deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jdbc-resource(1AS), asadmin-list-jdbc-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-jdbc-resource(1AS)
All times are GMT -4. The time now is 11:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy