#!/bin/sh ######################################################################## # This "pr-owners" script displays the content of the "owners.list" # file in a human readable format. Use it like this: # # $ ./pr-owners owners.list | less # ######################################################################## awk ' function trim( s, v ) { v = s sub( /^[ \t]*/, "", v ) sub( /[ \t]*$/, "", v ) return( v ) } BEGIN { FS = "|" } { sub( /#.*$/, "" ) } NF == 6 { product = trim( $1 ) component = trim( $2 ) description = trim( $3 ) initialowner = trim( $4 ) qacontact = trim( $5 ) initialcclist = trim( $6 ) if( others ) { printf "\n" } others = 1 printf "%s/%s\n\n", product, component printf "\tOwner:\t%s\n", initialowner printf "\tQA:\t%s\n", qacontact printf "\tCC:\t%s\n", initialcclist printf "\n" # printf "\t%s\n", description nwords = split( description, words, /[ \t]/ ) # printf "%d words\n", nwords leadin = "" sep = "" line = "" for( i = 1; i <= nwords; ++i ) { word = words[ i ] if( (length(word)+length(sep)+length(line)) >= 64 ) { printf "\t%s\n", line line = "" sep = "" } line = line sep word sep = " " } if( length( line ) > 0 ) { printf "\t%s\n", line } } ' $@