Artificial intelligent assistant

Bash for loop create folders; do I have to escape some chars? I want to create 5 files with the same name but with an incremental counter. If I do: for i in {1..5}; do touch hallo_$i; done I get `hallo_1`, `hallo_2`, `hallo_3`, etc. If I do: for i in {1..5}; do touch company-price-$i_spec.rb; done I get: `company-price-.rb` Do I have to escape something? Could it be that bash thinks I want to remove/subtract from the `$i` variable? If I escape `.` and `-` I still got the same result. Any hints?

You must use the braced form of variable expansion:


for i in {1..5}; do touch company-price-${i}_spec.rb; done


otherwise, `bash` will see `$i_spec` as a variable expansion, not `$i`.

From `bash` manual:


The basic form of parameter expansion is ${parameter}. The value of
parameter is substituted. The braces are required when parameter is a
positional parameter with more than one digit, or when parameter is
followed by a character that is not to be interpreted as part of its name.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 318589c002ba6e9a2c81e0c62da5c2c9