The following lines append the content of essay_i.txt to the end of essay1.txt:
touch essay1.txt
for (( i = 1 ; i <= 10 ; i++ )); do
sed '2p' essay_"${i}".txt >> essay1.txt
done
How should I change it so that the first line of each of essay_i.txt are not copied (i.e. only copy line 2->end) ?
tail -n +2 essay_i.txt >> essay1.txt– belacqua Feb 07 '11 at 16:56awk 'FNR>1' essay_[0-9].txt essay_[1-9][0-9].txt > essay1.txt. Would be even shorter if the numbers in the filenames were zero-padded. – geirha Feb 07 '11 at 20:55