#!/bin/bash TMP="/tmp/addheader.tmp" LIGNE=`grep -n ^$ $1|head -n1 |cut -d: -f1` sed "${LIGNE}s/^$/X-Tag:Test\n/" $1 >$TMP mv $TMP $1