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/>.
14 # let's try an error message first
17 # first, set up a known environment
25 shopt -s expand_aliases
32 shopt -s interactive_comments
38 shopt -u shift_verbose
42 # Now, start checking the output
43 builtin printf -- "--\n"
44 shopt -p # list 'em all
45 builtin printf -- "--\n"
46 # test specific variables
51 builtin printf -- "--\n"
53 builtin printf -- "--\n"
55 builtin printf -- "--\n"
58 # Now set up another known environment
78 set -o interactive-comments
84 builtin printf -- "--\n"
87 builtin printf -- "--\n"
89 builtin printf -- "--\n"
92 # test specific variables
93 builtin printf -- "--\n"
97 builtin printf -- "--\n"
99 builtin printf -- "--\n"
101 builtin printf -- "--\n"
105 builtin printf -- "--\n"
109 ${THIS_SH} ./shopt1.sub
111 # test whether or not temporary variable assignments that manipulate posix
112 # mode restore the previous state or the default non-posix state
113 ${THIS_SH} -c 'shopt -s expand_aliases ; shopt expand_aliases ; POSIXLY_CORRECT=y true ; shopt expand_aliases'