Six Stars

how to Use tSystem ??

How to use tSystem (Cmd) function , how to get the return output value and match based on the condition,

 

Flow:

 

tSystem (Command: df /dev/sda1)  ----  tlogRow ( log returns :

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 476575768 103320956 349023132 23% )

 

Then if percentage get more that 75 % we need to get some message .

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve Stars

Re: how to Use tSystem ??

Hi,

You may redirect the output to a file then read read it as a standard text file.

You may also choose the option to set "Standard Output" to "to Global variable" then retrieve the value from the global variable.

In this case, you should use an awk command to extract the % value from the df result then return only this value to the Talend job.

This link may also helps.


TRF
1 REPLY
Twelve Stars TRF
Twelve Stars

Re: how to Use tSystem ??

Hi,

You may redirect the output to a file then read read it as a standard text file.

You may also choose the option to set "Standard Output" to "to Global variable" then retrieve the value from the global variable.

In this case, you should use an awk command to extract the % value from the df result then return only this value to the Talend job.

This link may also helps.


TRF