Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Tests with arrays
- X-seq: zsh-users 16546
- From: meino.cramer@xxxxxx
- To: zsh-users@xxxxxxx
- Subject: Tests with arrays
- Date: Sat, 29 Oct 2011 06:52:50 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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