The echo command is echoing just an empty line, and each line in unix/linux terminates with one character referred to as a newline character. On other platforms it may be referred to as the linefeed or LF character. Code-wise, this is the decimal value 10, which is also octal value 12.Let's echo an empty line and send it to a file:
echo > emptyline
wc -l < emptyline
ls -l emptyline
You can see from the above that we created a file with a single line, and the total size of that file is one character. That one character is the newline character that terminates that one empty line.
For the command string in question, the output of the echo (the empty line terminated by a linefeed) is not being sent to a disk file, but instead it is sent (piped) forward as input to the next command, which in this case is a tr command.
This particular tr command will change each linefeed character to a Ctrl-A character. An easy way to specify these special characters is via their octal values of 12 and 1 respectively.
The output of this entire pipe (a single Ctrl-A character) is captured in a shell variable named A. Another way to see what is going on is break it apart like this:
echo > emptyline
cat emptyline | tr '\012' '\001' > controlA
ls -l emptyline controlA
A=`cat controlA`
The ls command shows that both the emptyline and controlA files have a total size of one character. That character for emptyline is a newline (octal value 12), and the character for controlA is a Ctrl-A (octal value 1).
If you call each of these files up in vi, you will see nothing in emptyline because vi does not show the newline characters that terminate each line. But when you vi controlA, you will probably see the Ctrl-A character, represented on the screen as ^A. But there is a vi setting that tells whether it should visibly show non-graphical characters or not.
And you ask why he wants to use a non-printable character as a separator. If your old and new text strings are hard-coded, then of course you would know what they are, so you can use a separator (maybe a slash) that is not contained in either your old or new strings. But in this case, the old and new strings are coming in as variables $1 and $2. We do not know what these strings will be ahead of time. If you use a slash such as s/$1/$2/ then there will be an error if either $1 or $2 contains a slash.
So he wants to use a special separator that will never appear in a normal ascii data file.