View difference between Paste ID: 5HjXjrfV and Ai3D52nf
SHOW: | | - or go back to the newest paste.
1
#!/bin/bash
2-
2+
3
#typeset -i LINE
4-
4+
5-
#typeset -i LINE
5+
6
7
while read operator LINE ; do
8-
8+
9
#echo $LINE | tr -d '[:alpha:]' | read param2
10-
10+
11-
11+
echo $param2, ${#param2} 
12
13-
13+
if [[ ${#param2} -eq 0 ]] ; then
14
	echo $0: error
15
	exit 3
16-
16+
else	
17-
echo $param2, ${#param2}
17+
	if [ $operator='+' ] ; then
18-
 
18+
19-
19+
20
		echo $total
21-
if [[ ${#param2} -eq 0 ]] ; then
21+
22
		echo $operator 
23
		total=total-$param2
24-
24+
		echo $total
25-
	exit 3
25+
	else 
26
		echo error
27-
else
27+
		exit 2
28-
	
28+
	fi
29-
if [ $operator='+' ] ; then
29+
30-
30+
31
echo total: $total
32-
32+