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/>.
15 # arithmetic operators for conditional commands and arithmetic commands
20 key='x],b[$(echo uname >&2)'
22 key2='` echo >&2 foo`'
25 key5='$( echo 2>& date)'
37 [[ assoc[$key] -eq assoc[$key] ]]
40 [[ assoc[$key] -gt assoc[$key1] ]]
43 [[ assoc[$key2] -lt assoc[$key] ]]
46 [[ assoc[$key] -eq assoc[$key3] ]]
49 [[ index[7<(4+2)] -le assoc[0] ]]
51 [[ index[$key4] -le assoc[0] ]]
57 echo "${assoc[$key5]}"
81 [[ -v assoc["$key"] ]]
86 [[ -v assoc["$key4"] ]]
89 [[ -v assoc['$key'] ]]
91 [[ -v assoc['$key4'] ]]
109 # this still performs expansion
124 printf '[[ -v assoc[%s] ]]; $?=%s\n' "$1" "$?"