find with xargs to rm found files

I believe what is happening is rm is executing in the script on every directory and on failure of the first it stops although returns status 0.

find $HOME -name /directory/filename | xargs -l rm

This is the code I use but file remains. I am using sun solaris system which has way limited set of utilities compared to Ubuntu

Is your rm aliased to rm -i ? did you try rm -rf instead of just rm..?

The above syntax for "find" will never find any file.

Please post a the full hierarchial name of example files which you wish to find and delete - stating which directory tree(s) to search.

Also, do any of your target filenames or directory names contain space characters?

I figured it out. Odd to me. If find receives just a filename it will append the full path to xargs which delivers it to rm.

find $HOME -name "$1" -exec rm {} \;

Find will retrieve the full path to the command-line argument and put it in {}

Works. now I just need to figure out how to parse a string of paths separated by new line

find $HOME -name "$1" | xargs rm

Jean-Pierre.