Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Tests with arrays



Hi,

There are two environment variables, say

    FILES_A

and

    FILES_B

. They were initialized as follows (example):

FILES_A="foo
         bar
         beta
         gnu
         gnats
         bob
         eve
         acme
         phi
         kilroy"
         
FILES_B="bar
         foo
         gnats
         eve
         alice
         gnu
         alpha
         acme
         epsilo
         bob"


I cannot change this, since these vars are setup in a file by someone
else - I only have to process them.

The contents of both are never sorted.

First step: How can I convert the contents of that vars easily and in a zshy way into
two arrays FILES_A_ARR and FILES_B_ARR?

Step two: How can I remove any item contained in FILES_B_ARR from FILES_A_ARR and echo each item in FILES_B_ARR 
which is not in FILES_A_ARR easily and in a zshy way?
         
Thank you very much in advance for any help!
Have a nice weekend!
Best regards,
mcc




Messages sorted by: Reverse Date, Date, Thread, Author