<?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>question [Closed] : How to store output of shell script in HDFS in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229933#M191786</link>
    <description>&lt;P&gt;HI All,&lt;BR /&gt;I have a shell script on HDFS as well as the locally named script.sh contains echo Hi.&lt;/P&gt;&lt;P&gt;I could execute the &lt;STRONG&gt;script.sh&lt;/STRONG&gt; file on locally and store output on locally of course. &lt;/P&gt;&lt;P&gt;But I want to execute &lt;STRONG&gt;script.sh&lt;/STRONG&gt; file (wherever on local or on HDFS) and store output on HDFS.&lt;/P&gt;&lt;P&gt;I have done following;&lt;/P&gt;&lt;P&gt;script.sh&lt;/P&gt;&lt;PRE&gt;#!/bin/bash
echo "`date` hi" &amp;gt; /tmp/output&lt;/PRE&gt;&lt;P&gt;bash script.sh&lt;/P&gt;&lt;P&gt;above command ran successfully. but if I changed the output path it is giving me an error that ;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;EM&gt;script.sh: line 2: hdfs://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/user/oozie/output/shell: No such file or directory&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;#!/bin/bash 
echo "`date` hi" &amp;gt; hdfs://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/user/oozie/output/shell&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78444-shell.jpg" style="width: 997px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15060iD7FE765CAF039B7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78444-shell.jpg" alt="78444-shell.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kindly help me for this.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jay.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 00:51:59 GMT</pubDate>
    <dc:creator>pateljay</dc:creator>
    <dc:date>2019-08-18T00:51:59Z</dc:date>
    <item>
      <title>[Closed] : How to store output of shell script in HDFS</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229933#M191786</link>
      <description>&lt;P&gt;HI All,&lt;BR /&gt;I have a shell script on HDFS as well as the locally named script.sh contains echo Hi.&lt;/P&gt;&lt;P&gt;I could execute the &lt;STRONG&gt;script.sh&lt;/STRONG&gt; file on locally and store output on locally of course. &lt;/P&gt;&lt;P&gt;But I want to execute &lt;STRONG&gt;script.sh&lt;/STRONG&gt; file (wherever on local or on HDFS) and store output on HDFS.&lt;/P&gt;&lt;P&gt;I have done following;&lt;/P&gt;&lt;P&gt;script.sh&lt;/P&gt;&lt;PRE&gt;#!/bin/bash
echo "`date` hi" &amp;gt; /tmp/output&lt;/PRE&gt;&lt;P&gt;bash script.sh&lt;/P&gt;&lt;P&gt;above command ran successfully. but if I changed the output path it is giving me an error that ;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;EM&gt;script.sh: line 2: hdfs://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/user/oozie/output/shell: No such file or directory&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;#!/bin/bash 
echo "`date` hi" &amp;gt; hdfs://&amp;lt;HOST&amp;gt;:&amp;lt;PORT&amp;gt;/user/oozie/output/shell&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78444-shell.jpg" style="width: 997px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15060iD7FE765CAF039B7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78444-shell.jpg" alt="78444-shell.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kindly help me for this.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jay.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 00:51:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229933#M191786</guid>
      <dc:creator>pateljay</dc:creator>
      <dc:date>2019-08-18T00:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: [Closed] : How to store output of shell script in HDFS</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229934#M191787</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/17868/jay.html" nodeid="17868"&gt;@JAy  PaTel&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You cannot directly write the output of echo to hdfs file. Instead you can do like below&lt;/P&gt;&lt;PRE&gt;echo "`date` hi" &amp;gt; /tmp/output ; hdfs dfs -appendToFile /tmp/output /tmp/abc.txt&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;-Aditya&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 18:58:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229934#M191787</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-15T18:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: [Closed] : How to store output of shell script in HDFS</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229935#M191788</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt;&lt;P&gt;Thank you Aditya. Your observation worked for me.&lt;/P&gt;&lt;P&gt;NOTE:&lt;/P&gt;&lt;OL&gt;
&lt;/OL&gt;&lt;PRE&gt;echo "`date` hi"&amp;gt;/tmp/output ; hdfs dfs -appendToFile &amp;lt;local_directory_path&amp;gt; &amp;lt;hdfs_directory_path&amp;gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jay.&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 13:28:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229935#M191788</guid>
      <dc:creator>pateljay</dc:creator>
      <dc:date>2018-06-16T13:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: [Closed] : How to store output of shell script in HDFS</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229936#M191789</link>
      <description>&lt;P&gt;
	This can be done without first writing to local disk...&lt;/P&gt;&lt;PRE&gt;echo "`date` hi" | hdfs dfs -appendToFile - /tmp/abc.txt&lt;/PRE&gt;&lt;P&gt;The hyphen "-" reads from stdin&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 00:04:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229936#M191789</guid>
      <dc:creator>whitsonk</dc:creator>
      <dc:date>2018-12-28T00:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: [Closed] : How to store output of shell script in HDFS</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229937#M191790</link>
      <description>&lt;P&gt;Awesome!!!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 02:18:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Closed-How-to-store-output-of-shell-script-in-HDFS/m-p/229937#M191790</guid>
      <dc:creator>manishsingh2k</dc:creator>
      <dc:date>2019-02-08T02:18:07Z</dc:date>
    </item>
  </channel>
</rss>

