I want to copy a file "test.sh" in directories which have all a subdirectory 2_bas (ex. prod1/2_bas, prod2/2_bas, etc...)
cp test */2_bas/
but I get the error message:
cp: omitting directory `prod1/2_bas' cp: omitting directory `prod2/2_bas'
A solution would be:
for dir in *; do [ -d "$dir" ] && cp test.sh "$dir"/2_bas ; done
But why does the first strategy not work?