/home/you/somefile
/home/you/subdir/anotherfile
(The absolute pathnames are important here. The cd
would fail on the second pass of the loop if you use relative
pathnames.) In the loop, the cd command uses
dirname to go to the directory where the file is.
The filename variable, with the output of
basename, is used several places -- twice on
the split command line.
If the previous code results in the error command line too
long, replace the first lines with the two lines below.
This makes a redirected-input loop:
find /home/you -type f -size +100000c -print |
while read path
--JP and ML