File: test2.sql

package info (click to toggle)
sqsh 2.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,000 kB
  • ctags: 1,113
  • sloc: ansic: 20,040; sh: 3,131; makefile: 514; sql: 94
file content (24 lines) | stat: -rwxr-xr-x 257 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!./sqsh -i

\func -x test_loop

	\if [ $# -ne 1 ]
		\echo "use: test_loop <n>"
		\return 1
	\fi

	\set x=0
	\while [ $x -lt ${1} ]
		\echo $x
		\set x=`expr $x + 1`
	\done

	\return 0
\done

\if test_loop ${1}
	\echo "All is well"
\else
	\echo "Doh!"
\fi