AnsweredAssumed Answered

PREP_PROCESS - no STDOUT

Question asked by ThomasHartmann82415949 on Apr 25, 2018
Latest reply on May 15, 2018 by Carsten_Schmitz

Hello,

 

i have a question with the PREP_PROCESS() Function:

 

! Set view
set -x
! Create a file with hallo inside
echo hallo > /home/automic/hallodatei.txt
! List to see if the file exists
ls -l /home/automic/hallodatei.txt
! Read the File
cat /home/automic/hallodatei.txt

 

_______CUT______

 

! Read the file now with the PREP_PROCESS
:SET &HND# = PREP_PROCESS("UNIX01","UNIXCMD",,"CMD=cat /home/automic/hallodatei.txt","UC_LOGIN=LOGIN.ALL")
:PROCESS &HND#
: SET &LINE# = GET_PROCESS_LINE(&HND#)
:ENDPROCESS

 

So i create a file with "hallo" inside and then i just read the file. 

That works fine. 

______CUT______

now - i need to do this with PREP_PROCESS but there is no STDOUT in the &HND#.

 

When i play with "echo hello" instead of "cat .....txt" i see the "hello" in the PROCESS &HND#

 

The Main Idea behind this is that i want to delete files with the HOST command. 

I have to know if the file has been deleted correct. IF the deletion was correct i want to clean a VARA Object. 

Of course, i could call another JOBS which delete the file and check the STATUS from that job - BUT - there is PREP_PROCESS which could allow me to do that in ONE Script. Would be great and useful for future actions! 

 

(PS: i am in the SCRIPT Course and here we all don´t know why the STDOUT sometimes is in the &HND# and why sometimes not)

Outcomes