Thanks,
The -printf is much faster!
Sed seem to be a great tool!!! Need to study that more.
To do exactly what I want, I need 3 sed expressions...
's/\.\///g' removing the leading ./ of each directory
's/\.//g' removing the single ., for current directory
's/\//\./g' replacing the / with a .
Instead of using 3 pipes, could this be expressed in a single invocation of
sed? (Performance is not much of an issue, but I think it looks neater.)
Just one more thing...
I will get multiple lines that are equal. Is it possible to remove
duplicates, in some easy way? (Of course, it's Linux! But how?)
Niclas
Kenneth Stephen wrote:
> Niclas,
>
> I do not understand how your script works, but if you want to use
> 'find' to get the path names you can do it this way
>
> find . -name \*\.java -exec dirname {} \;
>
> or
>
> find . -name \*\.java -printf "%h\n"
>
> The output of this can be piped onto :
>
> sed 's/\//\./g'
>
> ...and that will substitute '.' characters for the '/' characters.