Passing contents of file to extglob command terminal <p>I have a list of files that I don't want to remove from a location, I have found that by using extglob I am able to keep a pre-defined list of files using:</p> <pre><code>rm -r !(one.txt|Folder) </code></pre> <p>This will remove everything except <code>one.txt</code> and the folder <code>Folder</code>, however the list of files that I want to keep isn't always the same.</p> <p>Is there a way to pass a list of files/folders from a file e.g. <code>whitelist.txt</code> which won't be removed? </p> <p>I have managed to reformat <code>whitelist.txt</code> to have the contents:</p> <pre><code>one.txt|two.txt|Folder </code></pre> <p>However I am unsure of how to pass that into the command</p> <p>Just a note I am running OSX 10.11.</p> <p>Thanks,</p>