What does $$number in the shell or shellscript do? Something like this where they use $$3 and $$1.
Nothing. It's a make's construction.
What does that mean?
Make gets to $ characters first and does its own substitution. If you want a real $ character to make it into the shell, you have to double it, $$.
Of course, you don't want the shell substituting it either here! That's why it's in single-quotes. It goes through make, turning '$$1' into '$1', passes through the shell, turning '$1' into $1, then awk sees the $1 and understands it as 'the first field'.
Using $$variablename is useful in indirect reference
I'm finding it hard to put into words, but consider this example:
Suppose you want to find last command line argument, how can you find it?
[root@localhost ~]# echo $#
3
[root@localhost ~]# echo $3
file3
But with indirect reference you can directly get it.
[root@localhost ~]# eval echo "\$$#"
file3
Newer bash also support's following format.
[root@localhost ~]# echo "${!#}"
file3
For more scripts and articles, check bellow link.