I would like to find some directories via
find /path/to/a/dir -type d -links 2
and then for each pathname found by find, assumed to be stored in variable pathname, I would like to
stow -d "$(dirname "$pathname")" -t /home/t/bin "$(basename "$pathname")"
How can I combine the above with find -exec, something similar to:
find /path/to/a/dir -type d -links 2 -exec stow -d "$(dirname \{\})" -t /home/t/bin "$(basename \{\})" \;
I think it doesn't work because the shell performs the command substitutions before running find, and no pathname is found yet to replace \{\} in the command substitutions.
Thanks.
shinstead ofbashhere? – Tim Dec 02 '18 at 14:14shis guaranteed to exist on any Unix system. Onlinux,/bin/shis either a symlink to/bin/bashitself (eg. rhel, centos) or to something smaller and faster (/bin/dashon ubuntu and debian). – Dec 02 '18 at 14:28