#!/bin/sh # string multiply if [ $# -le 1 ]; then echo "Usage: ${0##*/} " >&2 exit 1 fi s="$1" shift 1 while [ $# -gt 1 ]; do s="$s $1" shift 1 done case $1 in ''|*[!0-9]*) echo "$2 is not a valid number" >&2; exit 2 ;; esac i=0 while [ $i -lt $1 ]; do printf "%s" "$s" : $((i += 1)) done