Add header lines to gzipped files
Had to loop through numerous gzipped files that required adding a header line to them. This script uses zcat to write in a compressed .gz file
#!/bin/bash
fname=$1
echo $fname
file_list=`find $fname -type f`
for current_file in $file_list
do
current_dir=$(dirname "$current_file")
echo $current_dir
cd $current_dir
zcat *.csv.gz | gzip > target_file.csv.a;
done