I have this one-liner command, that outputs every letter of a string in a line:
❯ a="string"; for ((i=0; i<${#a}; i++)); do echo "${a:$i:1}"; done
s
t
r
i
n
g
But if I execute the same command in VIM:
:r !a="string"; for ((i=0; i<${#a}; i++)); do echo "${a:$i:1}"; done
I get the following error:
E194: No alternate file name to substitute for '#'
How can I fix this?
I'm trying to insert those lines into VIM.