Show contents of a file by opening the file with the content string of a variable

3

I have a problem to show the contents of a file using the following command:

variavel="Affonso\,\ I.\ P..txt"
cat < "$variavel"

And running the same command on the terminal but without using a variable, it usually works like the following image:

How can I fix this?

    
asked by anonymous 29.07.2016 / 15:57

1 answer

1

You can do this:

variavel="$(< Affonso\,\ I.\ P..txt)"

echo "$variavel"
    
29.07.2016 / 16:17