I need to read content of the ssh key using the given path resides in a file like following:
my ssh private key is:
When I call
cat ~/.ssh/firstname.lastname in terminal on ubuntu, I get the expected result. However, if I would get the path to my ssh key from any text file, then I get
cat: '~/.ssh/firstname.lastname': No such file or directory.
For instance, I have
path_to_key.txt file containing single line
cat $(cat path_to_key.txt) in terminal returns me error message mentioned above.
All files reside under the same directory and callings happen also from that directory.
Why I can not "cat" in such a way ?