Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -- 1 1 1 1 1 1 1 1 1 1
- read -p "what is P's value? " num
- P=$num
- #lets say 3
- echo $P
- # 3
- sub=$((10-$P))
- # 7
- echo $sub
- # 7
- while (($1<1000)) # if its less then 1000 its true
- do
- # set -- $1 $2 $(($1+$2)) #### original version
- set -- $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $(($"($sub)" + $10)) # 11th iteration is supose to be $10 plus $7 making $11 = 2
- printf " %d" $1 # print me digits of what ever value $1 is
- shift # shift focus to the left 1 place from $3 to $2 in the original
- # disired output needs to be 1 2 3 4 5 7 10 14 19 26 ect... in this example above
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement