KB Article #179415

ATOE to check all arguments

Problem

In a workflow which uses ATOE as a Function Class, if ATOE does not have any input it runs continuously without throwing an error and stops the workflow execution (the program actually waits for a keyboard input when input is not available). The Function Class is not able to check all arguments, because they are redirections of STDIN and STDOUT:

FCTNCALL=$ACTISEDI/bin/atoe < $(INPUT) > $(OUTPUT) 2> $PROTFILE


Resolution

The program $ACTISEDI/bin/atoe needs to be wrapped by another program/script, which will check the existence of input arguments. It is suggested that the script $ACTISEDI/custom/atoe.sh be created with the following content:

#!/bin/bash

if [ -t 0 ]; then
    echo "No std input"
    exit 1
fi
atoe
exit $?

and that the ATOE Function Class be modified in $ACTISEDI/param/newconfig/fctn_dcl.cfg as follows:

from

FCTNCALL=$ACTISEDI/bin/atoe < $(INPUT) > $(OUTPUT) 2> $PROTFILE

to

FCTNCALL=$ACTISEDI/custom/atoe.sh < $(INPUT) > $(OUTPUT) 2> $PROTFILE

Note that $ACTISEDI/custom/atoe.sh requires execution rights (chmod +x $ACTISEDI/custom/atoe.sh).