I'm working on some script to help organize some stuff. I have simplified my code down to this from my original:
$ echo $(find -type d -maxdepth 5 | grep -E "\./([^/])*/([^/])*/([^/])*/([^/])*"
| cut -d'/' -f 3 | sort | uniq -d | xargs -I R sh -c 'echo -e "alpha \n"')
(R actually doesn't do anything here but it's used in the original)
Particularly, I think something is wrong with my xargs
xargs -I R sh -c 'echo -e "alpha \n"'
What I would look to see happen is alpha
to be printed several times, each on a newline. However, my output looks like
alpha alpha alpha...
I've been scouring around the internet trying to find how to fix this but it's no use. I've just started experimenting with bash, can someone please point out what I'm doing wrong?