Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to use unix rm command in t system component to remove the previous files, but its not working , I am using following line for cmd to run on unix box.
single cmd
"rm "+context.dir+"/file_loc/load*"
to remove all files starting with load, I dnt want to use get file list and other components to delete files, Can someone tell me what I am doing wrong ?
I tried with
"cmd /c"+context.dir+"/file_loc/load*" >> this failed too in a single cmd.
Thank you !
Hello ,
Your command must be:
new String[]{"/bin/bash","-c","rm"+context.dir+"/file_loc/load*"}
here, the difficulty where not the context.dir, but the * character at the end because it's a special character
cmd /c is for windows
For inbuild command on linux it's bash -c
You can also set an array of command with all the elements of the command string. More information aboiut special character usage here: https://community.talend.com/s/article/Executing-a-Linux-command-with-a-pipe-using-a-tSystem-component-IOBiH
Can someone pls guide me here ?
could you please paste your error here ?
Hello ,
Your command must be:
new String[]{"/bin/bash","-c","rm"+context.dir+"/file_loc/load*"}
here, the difficulty where not the context.dir, but the * character at the end because it's a special character
cmd /c is for windows
For inbuild command on linux it's bash -c
You can also set an array of command with all the elements of the command string. More information aboiut special character usage here: https://community.talend.com/s/article/Executing-a-Linux-command-with-a-pipe-using-a-tSystem-component-IOBiH
Thank you tsesdl (Talend) ,your solution worked !