Using this approach, your new file will contain a literal
[fo]* as expected. Alternatively, you could use backslash
escaping to tell bash that [, ] and *
should be treated literally rather than as wildcards:
$ echo \[fo\]\* > /tmp/mynewfile.txt
Both approaches will work identically. Since we're talking about backslash
expansion, now would be a good time to mention that in order to specify a
literal \, you can either enclose it in single quotes as well, or type \\
instead (it will be expanded to \).