#!/bin/sh # @(#) Revision 1.2 - 04/03/99 # delimit # # Delimit each line with a beginning and ending token. # # usage: delimit token [file] # # If you find this script useful, you might want to explore the -vet # options to cat. # # ============================================================================= # Andrea Whitlock, Mobius Software Services # whitlock@mobius-soft.com # # Bug reports, questions, and suggestions should be emailed to: # mobius@mobius-soft.com # # This software is provided under the terms of the GNU copyleft # (ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0), without a warranty # of any kind. Use at your own risk. # ============================================================================= # # configure me ################################################################ AWK=awk #AWK=nawk #AWK=gawk # configure me end ############################################################ if [ ! "$1" ] then echo "usage: `basename $0` token [file]" echo "example: `basename $0` \"|\" myfile.txt" exit 1 fi token="$1" file="$2" cat $file | $AWK '{ printf("%s%s%s\n", t, $0, t) }' t="$token"