#!@awk@ -f

BEGIN {
	if (ARGC != 3){
		print "usage: transport_broken_echo id ''" > "/dev/stderr"
		exit 77
	}

	id = ARGV [1]
	ARGV [1] = "-"

	ARGV [2] = ""

	# emulate totally broken NODE==4
	if (id == 4){
		system("sleep 1")
		exit 3
	}
}

{
	print "I'll output " $1
	if ($1 == id && id >= 1){
		# emulate broken TASK==NODE where NODE >= 1
		exit 1
	}

	print $1          # echoing input
	print "success"   # This is a keyword! Not a random word ;-)

	print ""          # end of task marker
	fflush()          # end of task MUST BE FLUSHED!!!
}
