I've got the beginnings of a script that I'm putting together to check Xen hosts... this question is twofold really. Firstly I've got the below code snippet;
TMPFILE001=/tmp/FILE001.rx TMPFILE002=/tmp/FILE002.rx TMPFILE003=/tmp/FILE003.rx xe vm-list params=uuid,is-control-domain | grep -B1 true | grep uuid | awk {'print $5'} > $TMPFILE001 xe vm-list params=uuid --minimal | tr ',' '\n' > $TMPFILE002
So this gives me two lists, I want to remove anything that appears in FILE002.rx from appearing in FILE001.rx and output that to FILE003.rx.
Ideally I'd not have any files used in this at all but I was struggling to get it working by trying to capture them in variables.
So if possible it would be better to have the script run, compare the output of the two commands and only show the remainder once the output of command 2 has been taken away from command 1.
Output of command 1;
cat /tmp/FILE001.rx 468190e5-c78b-4337-8094-20638353b470 5926bbf3-c48c-4c2a-8113-d7e58520cfe7 3f98ee14-5e60-4e9b-852a-f924ffe80791
Output of command 2 (trimmed);
cat /tmp/FILE002.rx | head -5 37ae6b9e-8a00-ab10-7e17-3d70ab275b9b d8208537-0d69-1332-9301-4699d194430f 1cf06668-5450-4d44-a7ba-c2c7b6bcd6b2 7d11c6e3-48ef-0e5e-c6ed-e8f2548533fd 7d3d0ba3-a6d6-d2a7-99f0-06fa74e625fa
grep
manpage for-F
. Not posting as an answer as its just a lead...