summaryrefslogtreecommitdiffstats
path: root/eshtrans/funcparams.esh
blob: 8630eeebb22cde509a4018ccffa348dec8bfaf39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Example of parameter lists and argument type checking.

greet(bool doprint, int i, string s)
{
	if ${doprint}; then
		while [ ${i} -gt 0 ]; do
			printf '%s\n' "${s}"
			i=$((${i} - 1))
		done
	fi
}

bye(void)
{
	printf 'Goodbye, cruel world!'
}

main()
{
	greet true 3 'Hello, world!'
	bye
	return 0
}