X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=text%2Fsplit_body_from_headers;fp=text%2Fsplit_body_from_headers;h=7e2b3f4dab2aeb1ee9eabd5ca8ac7dd4e2fe15b8;hp=0000000000000000000000000000000000000000;hb=f9201dc2d1699f5161e5e29690a1634e8063bb85;hpb=d1812fa8c4c9e220978d650adb3611c978a2a56b diff --git a/text/split_body_from_headers b/text/split_body_from_headers new file mode 100755 index 0000000..7e2b3f4 --- /dev/null +++ b/text/split_body_from_headers @@ -0,0 +1,13 @@ +#!/bin/bash +START=$2 +if [ ! $START ]; then + START=1; +fi +tail -n +$START $1 | head -1 > $1.headers +echo "wrote $1.headers (line $START)" +tail -n +`expr $START + 1` $1 > $1.no_headers +echo "wrote $1.no_headers (after line $START)" +if [ "$START" -gt "1" ]; then + tail -n +$START $1 > $1.with_headers + echo "wrote $1.with_headers (starting with line $START)" +fi