The problem is this: a script generates (very) many
variables that have a certain pattern to them, like this:
$ AB_0_0=1
$ AB_0_1=2
At some point I need to 'unset' all of them:
$ unset AB_0_0 AB_0_1
This is practical only for a few of them. Is there a way
to unset all of them in some simple fashion, like
$ unset AB*
I know the above (which is meant to be 'regexp-like')
doesn't work, but this is the idea I am after.
If the variables were all exported, one could think of
something like (not pretty):
$ env | grep '^AB' | while read var
do unset ${var%%=*}
done
but my variables are not exported (so 'env' doesn't output
them).
Any idea?
---Zdenek
--
=========================================================
VNET: 557-4844 Silicon Graphics SA
Tel : +41-22-710.4844 18, Ave. Louis Casai, 1209 Geneva
Fax : +41-22-710.4860 Switzerland