Tag Archives: KJ

Print one's place for 1 to N times, ksh Perl whatever?

By KmJohnson

Hello all,
I would like to create a for loop or whatever is quick that will print the one’s place of a number for 1-N times
say for example a printed page formatting is 132 characters wide,
I would like a single line

123456789012345678901234567890… …012

That is 132 characters long. I am putting this in a simple print test program and want the recipient to see at a glance that the printing is not getting truncated for any reason.

I see in a similar thread a slick way to print a single character N times

In these below cases if one * was missing (due to printer/lp miss configuration) in a string of 132 your eye could miss it easily.. TIA. –KJ

nawk ‘BEGIN{$1000=OFS=”*”;print}’ < /dev/null
perl -le ‘print “*” x 1000’
printf “%01000d”|tr “0” “*”

http://www.unix.com/shell-programmin…cters-ksh.html

From: http://www.unix.com/shell-programming-scripting/220881-print-ones-place-1-n-times-ksh-perl-whatever.html