When you execute `cat /proc/$$/mem` the variable `$$` is evaluated by by bash which inserts its own pid. It then executes `cat` which has a different pid. You end up with `cat` trying to read the memory of `bash`, its parent process. Since non-privileged processes can only read their own memory space this gets denied by the kernel.

Here's an example:

 $ echo $$
 17823

Note that `$$` evaluates to 17823. Let's see which process that is.

 $ ps -ef | awk '{if ($2 == "17823") print}'
 bahamat 17823 17822 0 13:51 pts/0 00:00:00 -bash

It's my current shell.

 $ cat /proc/$$/mem
 cat: /proc/17823/mem: No such process

Here again `$$` evaluates to 17823, which is my shell. `cat` can't read my shell's memory space.