#!/bin/sh

INFOLOAD+="\n --- What Arguments Got This Script To Run?\n"
INFOLOAD+=$(/bin/echo $@)
INFOLOAD="\n --- On Which Batch Node Has This Script Run?\n"
INFOLOAD+=$(/bin/hostname)
INFOLOAD+="\n --- Under Which User Has This Script Run?\n"
INFOLOAD+=$(/usr/bin/whoami)
INFOLOAD+="\n --- What Environment Variables Has This Script Had?\n"
INFOLOAD+=$(/bin/env)
INFOLOAD+="\n --- Lets Read The Input Data We Staged With The Job\n"
INFOLOAD+=$(/usr/bin/cat mypayload.data)

# sleep a bit so that we can have a look into the queue
sleep 300

# write into the output file
/bin/echo -e "OUTPUT FILE START\n${INFOLOAD}\nOUTPUT FILE END" > mypayload.out

# and write to stdout
/bin/echo -e "STDOUT START\n${INFOLOAD}\nSTDOUT END"

# and also write something that would appear as error message
(>&2 /bin/echo -e "STDERR START\n get something into stderr as example for error output\nSTDERREND")


