toaruos/util/cpad.sh

14 lines
208 B
Bash
Raw Normal View History

2011-10-28 02:39:40 +04:00
#!/bin/bash
function cpad {
word="$1"
while [ ${#word} -lt $2 ]; do
word="$word$3";
if [ ${#word} -lt $2 ]; then
word="$3$word"
fi;
done;
echo "$word";
}