Alec Warner wrote:
> 
> The correct way to mess with each is to save the old value (IFS) or
> restore the previous setting (shopts).
> 
> local OLDIFS="$IFS"
> ...do stuff
> IFS="$OLDIFS"
> 
> set -s extglob
> ...do stuff
> set -u extglob
> 
> If you change a bunch of shell options or have no idea what you changed;
> you can also do fun magic like:
> 
> local SHOPTS=$(shopt -p)
> ..do stuff
> eval "$SHOPTS"
> 
> which should restore the previous options.
> 
Note, the examples above could be improved by prefixing your variables
(you don't want global collisions, trust me)

So fex KDE_SHOPTS or KDE_OLD_IFS instead of just OLD_IFS.

> Thanks,
> -Alec Warner

-- 
gentoo-dev@gentoo.org mailing list

Reply via email to