I'm looking for a tool that I can use from a bash script that can give me the list of parent directories for a given path.
e.g. given the input foo/bar/moocow I would like to get out:
I would like to evaluate a basename expression given an argument from xargs.
find . -name '*.txt' | xargs -I f cp f DIR_OUT/copied_$(basename f)
which gives no file or directory because $(...