#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
: ${THIS_SH:=./bash}

${THIS_SH} -c 'readonly non-identifier ; echo after: $?' bash
${THIS_SH} -c 'export non-identifier ; echo after: $?' bash

${THIS_SH} -c 'readonly non-identifier invalid+ident ; echo after: $?' bash
${THIS_SH} -c 'export non-identifier invalid+ident ; echo after: $?' bash

${THIS_SH} -o posix -c 'readonly non-identifier ; echo after: $?' sh
${THIS_SH} -o posix -c 'export non-identifier ; echo after: $?' sh

${THIS_SH} -o posix -c 'readonly non-identifier invalid+ident ; echo after: $?' sh
${THIS_SH} -o posix -c 'export non-identifier invalid+ident ; echo after: $?' sh

${THIS_SH} -c 'command readonly non-identifier ; echo command: $?' bash
${THIS_SH} -c 'command export non-identifier ; echo command: $?' bash

${THIS_SH} -o posix -c 'command readonly non-identifier ; echo command: $?' sh
${THIS_SH} -o posix -c 'command export non-identifier ; echo command: $?' sh

# invalid array references

${THIS_SH} -c 'export AA[4] ; echo array: $?' bash
${THIS_SH} -c 'readonly AA[4] ; echo array: $?' bash

${THIS_SH} -o posix -c 'export AA[4] ; echo array: $?' sh
${THIS_SH} -o posix -c 'readonly AA[4] ; echo array: $?' sh


