When I printout the content of a file with
echo $(cat /path/to/filename), it list my files and directions too. But when I do with
printf "$(cat /path/to/filename)\n" it works fine.
I tried also saving it into a variable
content='cat /path/to/filename' (also
content=$(cat /path/to/filename) and then print by
echo $content, but I getting the same result (list files and directions).
I want to store the content of the file into variable and pass the variable into my script as an input to next command.
Note that the content of my file has special character
* in it.