I've started to write a brainfuck compiler in bash.
The 'compiler' translates the code in assambly to compile it using gcc
.
The problem is, when I try to run it, it prints this error:
$ ./compiler test.bf
./compiler: Zeile 111: src: {0..45}: Syntax Fehler: Operator erwartet. (Fehlerverursachendes Zeichen ist \"{0..45}\").
(In english:
$ ./compiler test.bf
./compiler: Line 111: src: {0..45}: Syntax Error: Operator excepted. (Causal Error Char is \"{0..45}\").
)
As I might understand, It says that there is a fault in line 111:
...
for i in {0..${#src}} # line 109
do # line 110
case ${src:$i:1} in # line 111
...
(Here is the full code)
But I don't see any.
If the error is cause of the for loop, can you tell me how to make a for loop like in python:
for i in range(15):
...
Thanks in advance