#!/usr/bin/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()
}
