toaruos/util/cpad.sh
2014-03-11 01:55:51 -07:00

14 lines
208 B
Bash
Executable File

#!/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";
}