
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Redirect data to a file using echo in tSystem component
I need to run an echo command to redirect data into a file using echo in text. I know I can use bash or python script to do so. however, that is impossible so far as the destination file is defined from context section in Talend.
My command is :
"
"echo 'Full Refresh Ingestion' " + ">>" + context.textfile
However, the output only print out back the command I created -> Full Refresh Ingestion >> /path/ingest.txt
Is there any way I could do to save the statement I declare into a file that is already defined in Contexts, using tSystem component?
Please assist, thanks
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the command on Linux and it does not work on Linux.
"echo HELLO >> "+context.filepath
Try another way to log the output to a file, select ' standard output' on tSystem to global variable, and then output the value of global variable to file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I try this command using tSystem on Windows and it works.
"cmd /c echo HELLO >> "+context.filepath
Regards
Shong

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shong, tried before and i received this error message -> tSystem_1 Cannot run program "cmd": error=2, No such file or directory
DId I missed any config?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is your OS? Linux?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes linux

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the command on Linux and it does not work on Linux.
"echo HELLO >> "+context.filepath
Try another way to log the output to a file, select ' standard output' on tSystem to global variable, and then output the value of global variable to file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks!
