mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 10:12:38 +02:00
commit bash-20100129 snapshot
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
+13
-4
@@ -191,14 +191,23 @@ ok
|
||||
-7
|
||||
7
|
||||
7
|
||||
1
|
||||
1
|
||||
4
|
||||
5
|
||||
-3
|
||||
2
|
||||
4
|
||||
10000
|
||||
10000
|
||||
8 12
|
||||
./arith.tests: line 274: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
|
||||
./arith.tests: line 278: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 279: ((: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 275: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
|
||||
./arith.tests: line 279: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 280: ((: a b: syntax error in expression (error token is "b")
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
./arith.tests: line 290: b[c]d: syntax error in expression (error token is "d")
|
||||
./arith.tests: line 291: b[c]d: syntax error in expression (error token is "d")
|
||||
|
||||
@@ -262,6 +262,7 @@ echo $(( --7 ))
|
||||
|
||||
${THIS_SH} ./arith1.sub
|
||||
${THIS_SH} ./arith2.sub
|
||||
${THIS_SH} ./arith3.sub
|
||||
|
||||
x=4
|
||||
y=7
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
RANDOM=42
|
||||
(( dice[RANDOM%6+1 + RANDOM%6+1]++ ))
|
||||
echo ${dice[5]}
|
||||
|
||||
(( ++dice[RANDOM%6+1 + RANDOM%6+1] ))
|
||||
echo ${dice[6]}
|
||||
|
||||
v=4
|
||||
DIND=20
|
||||
|
||||
(( dice[DIND%6 + 1]=v ))
|
||||
echo ${dice[3]}
|
||||
|
||||
RANDOM=42
|
||||
|
||||
(( dice[RANDOM%6+1 + RANDOM%6+1]+=v ))
|
||||
echo ${dice[5]}
|
||||
|
||||
(( dice[RANDOM%6+1 + RANDOM%6+1]-=v ))
|
||||
echo ${dice[6]}
|
||||
|
||||
(( dice[RANDOM%6+1 + RANDOM%6+1]+=2 ))
|
||||
echo ${dice[11]}
|
||||
|
||||
(( dice[RANDOM%6+1 + RANDOM%6+1]*=2 ))
|
||||
echo ${dice[11]}
|
||||
|
||||
unset dice1 dice2
|
||||
RANDOM=42
|
||||
|
||||
for i in {1..10000}; do ((dice1[$RANDOM%6+1 + $RANDOM%6+1]++)); done;
|
||||
unset t; for i in ${dice1[@]}; do ((t+=i)); done; echo $t
|
||||
|
||||
foo="${dice1[@]}"
|
||||
|
||||
RANDOM=42
|
||||
|
||||
for i in {1..10000}; do ((dice2[RANDOM%6+1 + RANDOM%6+1]++)); done;
|
||||
unset t; for i in ${dice2[@]}; do ((t+=i)); done; echo $t
|
||||
|
||||
bar="${dice2[@]}"
|
||||
|
||||
if [ "$foo" != "$bar" ]; then
|
||||
echo "random sequences differ"
|
||||
fi
|
||||
Reference in New Issue
Block a user