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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -