gpt4 book ai didi

shell - Oozie shell 操作

转载 作者:可可西里 更新时间:2023-11-01 15:10:00 27 4
gpt4 key购买 nike

我有一个 oozie shell 操作,它从 HDFS txt 文件获取输入,但每次我调用 txt 文件时,它都说目录不存在,但它存在于服务器上。

这是我的 shell 脚本:

#!/bin/bash

Ingesta="MUM_APPs"
msj="'${1}'"
#alerta=`hdfs dfs -test -e /user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt`

while read line
do
line=${i}
Num=$(echo $line | cut -d '|' -f1)
Proceso=$(echo $line | cut -d '|' -f5)

if [ "$Proceso" == "*" ] || [ "$Proceso" == "$Ingesta" ]; then
source /user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/EnviaSMS.sh ${Num} "'ALERTA!! $Ingesta (`date +%d-%m-%Y` `date +%H:%M:%S`), $msj'"
fi`enter code here`

done < <(hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt)

编辑 1:

这是我得到的新错误:

sh: line 17: syntax error near unexpected token `<'
sh: line 17: `done < <(hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt)'
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.impl.MetricsSystemImpl).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

最佳答案

或者,您可以将脚本更改为:

hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt |\
while read line; do
echo "${line}"
#Some Stuff
#some more stuff
done

关于shell - Oozie shell 操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45334623/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com