Best way to clean up the bindings file

Latest response

Hello,

We are in the process of removing luns since an array is being decommissioned. I have a list of all of the WWID's of the luns that will be decom'd but am wondering the best way to delete them from the bindings file. I was thinking of writing a script using sed to do it, but don't know how to do a while loop with a sed delete pattern matched to the file of WWID's.

Responses

No need for a while loop. Create a file "wwid" where each line contains the delete expression of a wwid:

/<wwid1>/d
...
/<wwidn>/d

And then issue:

sed -i -f wwid /path/to/binding_file

This will delete inplace the lines containing the wwids.

Regards, Siem

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.