File: cmd_divide.in

package info (click to toggle)
paexec 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 904 kB
  • sloc: sh: 3,435; ansic: 1,959; makefile: 174; pascal: 19
file content (29 lines) | stat: -rwxr-xr-x 613 bytes parent folder | download | duplicates (3)
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
#!@awk@ -f

# This a sample command passed to paexec via option -c


{
	# Read tasks line-by-line

	if ($1 != 0){
		# Result which should not contain empty lines
		print "1/" $1 "=" 1/$1

		# "paexec -g" requires either "success" or "failure" in the end.
		# For non-zero input number x we are able to calculate 1/x
		print "success"
	}else{
		# Oops, dependent tasks will fail as well
		print "Cannot calculate 1/0"

		# "paexec -g" requires either "success" or "failure" in the end.
		print "failure"
	}

	# End of task marker, empty line by default
	print ""

	# In the end, stdout must be flushed
	fflush()
}