<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Not able to run Linux command using tSystem Component in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309149#M80400</link>
    <description>Hi RSH
&lt;BR /&gt;Could you try to run this command in Linux prompt to see it works before you use tSystem?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
    <pubDate>Wed, 29 Jul 2015 11:38:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-29T11:38:48Z</dc:date>
    <item>
      <title>Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309143#M80394</link>
      <description>Hello All,
&lt;BR /&gt;I am running following command in TOS using tSystem Component. But It is not performing the task rather displaying the contents in the console when its executable is run.
&lt;BR /&gt;sed 's/_DEV/_PROD/' input_file &amp;gt; output_file 
&lt;BR /&gt;I am passing input_file and output_file from context params.
&lt;BR /&gt;Please help.</description>
      <pubDate>Mon, 29 Apr 2013 11:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309143#M80394</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-04-29T11:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309144#M80395</link>
      <description>try this:&lt;BR /&gt;sed 's/_DEV/_PROD/' " + context.input_file + " &amp;gt; " + context.output_file</description>
      <pubDate>Tue, 30 Apr 2013 00:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309144#M80395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-30T00:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309145#M80396</link>
      <description>I think the issue is because you are using redirection ("&amp;gt;") in the command. Try using the below Java code in the command box:
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;new String[]{"/bin/bash","-c","sed 's/_DEV/_PROD/' input_file &amp;gt; output_file"}&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;A href="http://bit.ly/17ujlw0" target="_blank" rel="nofollow noopener noreferrer"&gt;Click here for more details on the same&lt;/A&gt;</description>
      <pubDate>Tue, 30 Apr 2013 03:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309145#M80396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-30T03:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309146#M80397</link>
      <description>Hello Vikram, 
&lt;BR /&gt;I want to add custom headers (only 1 line) in all my target txt files. I am using windows remote connection in that I use talend 5.6 linux box. I use following code but unable to add custom headers. 
&lt;BR /&gt;Code in tsystem(Use line Command)- 
&lt;BR /&gt;new String[]{"/bin/bash tempath='/home/UserName/Desktop/CI0.txt' Filepath='/home/UserName/Desktop/HeaderCi.csv' &amp;nbsp;for line in $temppath; do cat $Filepath $line&amp;gt;tmp &amp;amp;&amp;amp; mv tmp $line done"} 
&lt;BR /&gt;Error- 
&lt;BR /&gt;Exception in component tSystem_1 
&lt;BR /&gt;java.io.IOException: Cannot run program "/bin/bash tempath='/home/UserName/Desktop/CI0.txt' Filepath='/home/UserName/Desktop/HeaderCi.csv' &amp;nbsp;for line in $temppath; do cat $Filepath $line&amp;gt;tmp &amp;amp;&amp;amp; mv tmp $line done" (in directory "/home/UserName/Desktop/CI"): error=2, No such file or directory 
&lt;BR /&gt; at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042) 
&lt;BR /&gt;Note: 
&lt;BR /&gt;If I tick mark or not tick mark "Use Home directory" &amp;nbsp;, in both condition I get same error. 
&lt;BR /&gt;I use following command too but not working: 
&lt;BR /&gt;"sed -i '1s/^/'Custome_Header_Name'\n/' CI*.txt" 
&lt;BR /&gt;"echo 'Custome_Header_Name' | cat - CI0.txt &amp;gt; temp &amp;amp;&amp;amp; mv temp CI0.txt" 
&lt;BR /&gt;echo "$(echo 'Custome_Header_Name' | cat - CI0.txt)" &amp;gt; CI0.txt 
&lt;BR /&gt; 
&lt;BR /&gt;Please guide me.</description>
      <pubDate>Thu, 23 Jul 2015 11:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309146#M80397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T11:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309147#M80398</link>
      <description>Dear All,&lt;BR /&gt;Can anyone please guide me for same , as I am unable to resolve this problem.&lt;BR /&gt;Regards&lt;BR /&gt;Rsh</description>
      <pubDate>Mon, 27 Jul 2015 10:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309147#M80398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-27T10:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309148#M80399</link>
      <description>Dear Team,&lt;BR /&gt;Please help me out as I am running out of time..&lt;BR /&gt;Regards&lt;BR /&gt;RSH</description>
      <pubDate>Wed, 29 Jul 2015 08:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309148#M80399</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-29T08:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309149#M80400</link>
      <description>Hi RSH
&lt;BR /&gt;Could you try to run this command in Linux prompt to see it works before you use tSystem?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 29 Jul 2015 11:38:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309149#M80400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-29T11:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309150#M80401</link>
      <description>Hello Shong, 
&lt;BR /&gt;Thanks a lot for your reply. 
&lt;BR /&gt;Your suggestion to check in Linux prompt, Can you please tell me how to do it? This is first time I am using remote-&amp;gt;linux box-&amp;gt; talend(5.6) hence not sure how to use Linux. 
&lt;BR /&gt;Shong , can you please suggest steps to check it. 
&lt;BR /&gt;If you are talking about to check my code using CMD(PUTTY), then YES, my code works and I get my expected result in all my 100+ files. 
&lt;BR /&gt;Shong sir, can you please check my code in your environment if possible, because since last week I am working on same thing and not getting any result. 
&lt;BR /&gt;Please guide. 
&lt;BR /&gt;Regards 
&lt;BR /&gt;RSH</description>
      <pubDate>Wed, 29 Jul 2015 11:44:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309150#M80401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-29T11:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309151#M80402</link>
      <description>Hi RSH
&lt;BR /&gt;Yes, I meant to run this command in Linux CMD to make sure there is no syntax error in the command. Can you please upload a screenshot to show how your command works in Linux CMD.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 29 Jul 2015 11:47:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309151#M80402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-29T11:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309152#M80403</link>
      <description>I have 3 files in my drive i.e. 
&lt;BR /&gt;1. text file in which we get target output data from oracle source. File name is CI0.txt 
&lt;BR /&gt;2. Headerfile in which we have header format which is useful for froent end team (to load file in front end).File name is HeaderCI.csv 
&lt;BR /&gt;3. Script which has code to add header file data in target CI0.txt file.&amp;nbsp; 
&lt;BR /&gt;Now I have to run script from Putty. (Screen shot in attachment.) 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MERg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145772i03F8B5C23E58616A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MERg.png" alt="0683p000009MERg.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Even if we try normal single command like: 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;sed -i '1s/^/'Custome_Header_Name'\n/' CI*.txt&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;This code works in putty but not working in Talend.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME66.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141339i36691CFF587E6CB1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME66.png" alt="0683p000009ME66.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Talend Job Snapshot: 
&lt;BR /&gt;I am using same directory, same path, but normally It gives me an error "NO SUCH FILE DIRECTORY" or syntax error even though it shows me OK status. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME7D.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145684i2DC2D783CE8F3DFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME7D.png" alt="0683p000009ME7D.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Sir, can you please let me know where I made an error. 
&lt;BR /&gt;Regards 
&lt;BR /&gt;RSH</description>
      <pubDate>Wed, 29 Jul 2015 14:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309152#M80403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-29T14:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309153#M80404</link>
      <description>hi all,&lt;BR /&gt;try to wrap your sed command in a .sh file to avoid problem with special character &amp;amp; quotes.&lt;BR /&gt;hope it help&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Thu, 30 Jul 2015 08:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309153#M80404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-30T08:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run Linux command using tSystem Component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309154#M80405</link>
      <description>Bonjour Laurent,
&lt;BR /&gt;Thank you for reply. Yes, It works if I create an .sh file which contains&amp;nbsp;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;sed -i '1s/^/'Custome_Header_Name'\n/' CI*.txt&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;code, but my problem is after I migrate source data from oracle to txt file(split after 1000 records), this target txt folders gets deleted prior to new file creation on daily basis, so in this case my .sh script file will get deleted and to add custom header I need to create it again .sh file in particular folders.
&lt;BR /&gt;Conclusion: I need to pass header file path(Custome_HEader_Name) and folder name(target folders employee, students etc) path in which I have to add header.Henceforth I used following code:
&lt;BR /&gt;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;"/bin/bash tempath='/home/UserName/Desktop/CI0.txt' Filepath='/home/UserName/Desktop/HeaderCi.csv' &amp;nbsp;for line in $temppath; do cat $Filepath $line&amp;gt;tmp &amp;amp;&amp;amp; mv tmp $line done"&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;Please let me know in case you have some other work around.
&lt;BR /&gt;Thanks Again.
&lt;BR /&gt;RSH</description>
      <pubDate>Thu, 30 Jul 2015 09:47:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-run-Linux-command-using-tSystem-Component/m-p/2309154#M80405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-30T09:47:03Z</dc:date>
    </item>
  </channel>
</rss>

