Q:

Linux command substitution $(cat ...) confusion

I am configuring NPM to use TLS (this is unrelated).  I have some confusion with how the command substitution in BASH works..
I am issuing the following commands
npm config set cert "$(cat public.pem)"
This command works as intended setting the cert field in my .npmrc to the contents of public.pem
Next I issue the command 
npm config set key "$(cat private.pem)"
This command fails silently and sets the key field in my .npmrc to empty.
It seems the private key file starts with the standard -----BEGIN RSA PRIVATE KEY----- and my public key starts with Bag Attributes.  It seems the file starting with dashes is messing up my command substitution.
Thoughts?

A:

Where did the cat go in the failing command?
npm config set key "$(cat private.pem)"

Note that you can also use
$(< private.pem)

which should be a bit faster than calling cat.

