1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
64 # make sure unsetting a local variable preserves the `local' attribute
115 # make sure subshells can do a `return' if we're executing in a function
127 declare -F f1 # should print just the name
128 declare -f f1 # should print the definition, too
130 # no functions should be exported, right?
137 echo FUNCNAME = $FUNCNAME
142 echo before: FUNCNAME = $FUNCNAME
144 echo after: FUNCNAME = $FUNCNAME
147 echo before: try to assign to FUNCNAME
150 echo outside: FUNCNAME = $FUNCNAME
152 echo outside2: FUNCNAME = $FUNCNAME
154 # test exported functions (and cached exportstr)
161 ${THIS_SH} -c 'type -t zf'
162 ${THIS_SH} -c 'type zf'
164 ${THIS_SH} ./func1.sub
166 # tests for functions whose bodies are not group commands, with and without
167 # attached redirections
168 ${THIS_SH} ./func2.sub
170 # test for some posix-specific function behavior
171 ${THIS_SH} ./func3.sub
174 ${THIS_SH} ./func4.sub
178 echo "bad shell function redirection"