In a bash script I want to recursively chown all subfolders of an arbitrary folder with the user and group owners of that given folder.
My approach is something like using stat -c "%U %G" .
But that returns only a pattern of username[whitespace]groupname
Of course I could just try different tools to replace the whitespace with a :
but I would prefer to use a more "built-in" way if there is one, to just apply current ownership to the sub folders.