In bash how to get printf
take input interactively to print a sequence. I have tried the following:
read x; read y; printf '%s\n' {"$x".."$y"..5}
0
40
{0..40..5}
whence I am trying to get the output like this:
printf '%s\n' {0..40..5}
0
5
10
15
20
25
30
35
40
The problem is that you can't use variables that way in a bash brace expansion.
Instead, you can use
seq
:or more straightforwardly
or a C-style
for
loop:See for example