Reputation: 8375
Just like the title says,
domain='foo.com'
find . -iregex '.*\(html\|htm\)' -printf '%f\0' | \
xargs -0 sed -Ee "s:(http|https)\://(www.|)${domain}::g"
# sed: can't read index.html: No such file or directory
I am expecting
directory/directory/index.html
Not sure whats going on with find?
Upvotes: 0
Views: 86
Reputation: 164
Use "%h%f" to get the full path (relative to the current path).
find . -iregex '.*\(html\|htm\)' -printf '%h%f\0'
Upvotes: 1
Reputation: 5723
The manual page says:
%f File's name with any leading directories removed (only
the last element).
Upvotes: 2