#!/usr/bin/env bash
for year in all/*
do
echo -ne `basename $year .gz`"\t"
gunzip -c $year | \ awk '{ temp = substr($0, 88, 5) + 0;
q = substr($0, 93, 1);
if (temp !=9999 && q ~ /[01459]/ && temp > max) max = temp }
END { print max }'
done
I've a small doubt over this Awk script for reading a file which I found in a Hadoop book. In line number 5 (the one which starts with gunzip
), after the |
, what is the purpose of the backslash \
before awk?