Skip to content

Instantly share code, notes, and snippets.

View plank-sr's full-sized avatar

Old Account plank-sr

View GitHub Profile
@plank-sr
plank-sr / charruler.sh
Last active March 15, 2016 01:47
create a string starting with 1 and concat n+1, until you reach the charcter length you want, in this case 32
#!/bin/sh
# reset num to zero unset iteration if you want to run it over again.
num=0; unset iteration; while [[ $num -lt 32 ]] # continue to increase iteration until $num is 32
do
let num=$((1+$num)) # increase num by 1
let modu=$((num%10)) # get digits between 0 and 9
iteration="${iteration}${modu}" # concat previous iteration with modu
printf "%s\n" "${iteration}" # print iteration as a string so you can go past 20 decimal limit,
done # you can use echo instead of printf if you want