Shell how to concatenate strings in a macro

Hello all.

I have a throuble when I try to concatenate some strings in a shell script macro.
The script uses sh.
root@freebsd:~ # sh
[B]# name="john"
# name+=" doe"[/B]
name+=doe: not found
Can anyone identify where is mistake?
Last edited by a moderator:
I thought that the commands and syntax of SH was similar to Bash.
It's the other way around, Bash syntax is similar to the Bourne Shell (it existed long before bash).

And there's a difference between the Bourne shell and the Bourne Again Shell (bash). While technically on FreeBSD /bin/sh is the Almquist Shell.

I use this site a lot for reference: Stick to that and your script will work on all three shells.