Hi ,
I am processing some files using below shell script the problem for loop exit after processing some files even though it exist.After modifying file.txt
and rerunning the script and its running .Any Advise
for i in `cat /xx/file.txt |tr -s "," '\n' ` ; do
echo $i
input=/xx/20160108/$i/*.snappy
output=/yy/zz/20160108/$i
sudo -u hdfs hadoop jar /xx/hadoop-streaming.jar -D mapreduce.task.io.sort.factor=20 -D mapred.output.compress=true \
-input $input -output $output
rc=$?
if [ ${rc} -ne 0 ];then
echo "File not exist"
exit 1
fi
done
cat file.txt
10,11,12,13,14,15,16,17,18,19,20,21,22,23
6/02/16 01:56:40 INFO streaming.StreamJob: Output directory: /xx/20160108/14
15
sudo: sorry, you must have a tty to run sudo
File not exist