From: John Kelly on
On Sat, 19 Jun 2010 18:07:19 -0500, spcecdt(a)armory.com (John DuBois)
wrote:

>>how can I print n equal signs in a shell script

>printf %.0s= {1..20}

0 string precision and a sequence expression. Clever.


--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php

From: Giacomo Boffi on
Marc Muehlfeld <marc.muehlfeld(a)web.de> writes:

> how can I print n equal signs in a shell script, without using a for
> loop[?]

let's say you have an upper bound on the length of the "=" sequence
(in my example it is 60)

# 123456789+123456789+123456789+123456789+123456789+123456789+
# 1 2 3 4 5 6
a="============================================================"
n=20
echo ${a::$n}

--
> In tutti noi c'� un lato interista
Lato perlopi� nascosto dalle mutande.
--- Basil Fawlty, a reti unificate (IFQ+ISC)