unix commands in Informatica command task - what am I missing? -
i tried simple
if [ 1 == 1 ]; echo "hi"; fi >>/projects/ods/chk.txt
included in command task fails error code 512....
what missing here?
an if/fi
block cannot redirect output.
use
if [ 1 == 1 ]; echo "hi">>/projects/ods/chk.txt; fi
as indicate simple test case, if need output larger block of if/the/else/fi
or other logic, can wrap in process group , redirect output..
{ if [ 1 == 1 ]; echo "hi" else echo "nope" fi } >>/projects/ods/chk.txt
also, it's using ==
problem. typically you'd use 1 -eq 1
or other constructs if true ; then
, or if want math comparisons, use if (( 1 == 1 )) ; ...
, older shells may or may not support (( ... ))
test.
ihth
Comments
Post a Comment