Professional Documents
Culture Documents
HI All,
I have a shell script on HDFS as well as the locally named script.sh contains echo Hi.
I could execute the script.sh file on locally and store output on locally of course.
But I want to execute script.sh file (wherever on local or on HDFS) and store output on HDFS.
I have done following;
script.sh
#!/bin/bash
echo "`date` hi" > /tmp/output
bash script.sh
above command ran successfully. but if I changed the output path it is giving me an error that ;
script.sh: line 2: hdfs://<host>:<port>/user/oozie/output/shell: No such file or directory 81
SEGUIDORES
#!/bin/bash
Responstas
echo "`date` hi" > hdfs://<HOST>:<PORT>/user/oozie/output/shell
Respostas E
Comentários
MELHOR RESPOSTA
@JAy PaTel,
You cannot directly write the output of echo to hdfs file. Instead you can do like below
echo "`date` hi" > /tmp/output ; hdfs dfs ‐appendToFile /tmp/output /tmp/abc.txt
.
-Aditya
1 Esconder 1 · Partilhar
@Aditya Sirna
Regards,
Jay.
3 Esconder 1 · Partilhar
Awesome!!!
Sua resposta
HTML Editor
Preview Source
Preencha os detalhes...
0
Dica: Pode notificar um utilizador sobre esta publicação digitando @username
PUBLICAR RESPOSTA
THIS WEBSITE USES COOKIES FOR ANALYTICS, PERSONALISATION AND ADVERTISING. TO LEARN MORE OR CHANGE YOUR COOKIE SETTINGS, PLEASE READ OUR COOKIE POLICY. BY CONTINUING TO
BROWSE, YOU AGREE TO OUR USE OF COOKIES.