File: test.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 (35 lines) | stat: -rwxr-xr-x 412 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
25
26
27
28
29
30
31
32
33
34
35
#!./sqsh -i

\if ls -al 
	\echo hello
\fi

\if test $# -ne 1
	\echo "use: test.sql <digit>"
	\exit
\fi

\if [ $# -eq 1 ]
	\echo "wooo hoo"
\fi

\echo "Testing while loop"

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

\echo "If-Elif-Else logic"

\if test ${1} = 1
	\echo block one
\elif test ${1} = 2
	\echo block two
\elif test ${1} = 3
	\echo block three
\else
	\echo block four
\fi