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

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Ed Jaffe
Sent: Thursday, February 09, 2017 4:11 PM
To: [email protected]
Subject: Re: OMVS Mass Reassign of File Owner

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.

--
Edward E Jaffe
Phoenix Software International, Inc
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN
E-MAIL CONFIDENTIALITY NOTICE: This e-mail from Donegal Insurance Group may 
contain CONFIDENTIAL and legally protected information. If you are not an 
intended recipient, please do not copy, use or disclose this email or its 
contents to others; and please notify us by calling toll free (800) 877-0600 
x7880 or by replying to this message, and then delete it from your system. 
Delivery of this email to an unintended recipient is not a waiver of any 
attorney-client or other applicable privilege.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to