Newsgroups: comp.unix.shell
Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!lethe!tvcent!comspec!scocan!john
From: john@sco.COM (John R. MacMillan)
Subject: Re: adjusting string var to fixed length
Organization: SCO Canada, Inc.
Date: Tue, 04 Jun 1991 14:49:51 GMT
Message-ID: <1991Jun04.144951.28414@sco.COM>
References: <1991Jun3.181447.12656@mnemosyne.cs.du.edu>
Sender: news@sco.COM (News administration)

|  Could someone please tell me how blanks can be appended to string vars
|to make it fixed length?

If the fixed length is relatively short, something like the following
in sh/ksh will do:

var=foo
# Pad to 10:   10 spaces        10 dots
var=`expr "$var          " : '\(..........\).*'`
