I want to execute one command and I want that it is executed with a specific groupname, that I'm belonging to, but which is not my default group. So all files created will belong to that group. Is there a command for that?
There is chgrp
to fix it afterwards.
Then I found newgrp
(Changing my default primary GID for every login session), but that creates a subshell. Thus a oneliner newgroup <groupname> && cmd
does not work. And the shell needs to be closed later.
Both approaches looks error prone.