$$ is a special parameter that most shells interpret as the process ID of the shell. You should be able to see this by typing echo $$ on the command line and noting the number. Then try ps - one of the shells listed (perhaps the only shell, depending on your OS) should have the same process ID.
I am a little surprised at you getting a "not found" message on an echo statement - it should have just echoed 21271a2 (the process ID with "a2" concatenated).