On Thu, 9 Feb 2017 21:19:54 +0000, Pfister, Nathan wrote:

>You don't need sed to do so, that may just complicate it
>
>I would suggest find/exec.  Example below will find in current directory (.) 
>all files belonging to user 5001 (UID unless you have a user named "5001") and 
>change the owner to 0 (root).
>
>find . -user 5001 -exec chown 0 {} \;
>
>Second example, finds files in current directory (.) that belong to group 5001 
>(GID unless you have a group named "5001") and change the group to SOMEGROUP
>
>find . -group 5001 -exec chgrp SOMEGROUP {} \;
>
>Notice that chgrp, chown, and the user/group parameters of find will accept 
>either a user/group name or a UID/GID
>
Be careful.  Specify the option on chgrp and chown to not follow symbolic
links (I believe that is not the default.)  Else you may change the owner of
a file to which a link points.  Or use "! type l" in your find options.

>-----Original Message-----
>From: Of Ed Jaffe
>
>On 2/9/2017 1:04 PM, John P. Baker wrote:
>> Is there an OMVS command or utility, either from IBM or from a 3rd
>> party, to search thru the OMVS filesystem, locate all directories
>> and/or files having a specific GID and/or UID, and to then reassign
>> those directories and/or files to a new GID and/or UID?
>
>You can probably do this in one command by using the output of 'find' as input 
>to 'sed' or similar.
> 
A hazard with that is that nonstandard filenames may contain delimiter
characters (blank, newline, semicolon, ...) which cause unintended effects.
IBM's "skulker" tries to filter out such filenames and ignore them.  I found
one they overlooked and they took an integrity APAR for it.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to