[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: local - im functions , applies to set like -f too ?
From: |
Lawrence Velázquez |
Subject: |
Re: local - im functions , applies to set like -f too ? |
Date: |
Tue, 05 Nov 2024 16:26:13 -0500 |
On Tue, Nov 5, 2024, at 1:53 PM, #!microsuxx wrote:
> .. or does it restore only the shopts ? not set opts
Other way around. It restores "set" options but not "shopt" options.
$ cat /tmp/testlocal.bash
printopts() {
set -o | grep noglob
shopt extglob
}
testlocal() {
local -
set -f
shopt -s extglob
printopts
}
echo beginning; printopts
echo
echo middle; testlocal
echo
echo end; printopts
$ ./bash /tmp/testlocal.bash
beginning
noglob off
extglob off
middle
noglob on
extglob on
end
noglob off
extglob on
This is documented in the description of "local" and would have
been trivial for you to test yourself.
--
vq
- local - im functions , applies to set like -f too ?, #!microsuxx, 2024/11/05
- Re: local - im functions , applies to set like -f too ?,
Lawrence Velázquez <=
- Re: local - im functions , applies to set like -f too ?, #!microsuxx, 2024/11/05
- Re: local - im functions , applies to set like -f too ?, Greg Wooledge, 2024/11/05
- Re: local - im functions , applies to set like -f too ?, #!microsuxx, 2024/11/05
- Re: local - im functions , applies to set like -f too ?, #!microsuxx, 2024/11/05
- Re: local - im functions , applies to set like -f too ?, Chet Ramey, 2024/11/06
- Re: local - im functions , applies to set like -f too ?, #!microsuxx, 2024/11/06