I am trying to access a file that has a variable in its name (i.e. file_n: file_1, file_2, etc). I am trying to access it with
cat $file_$n
But this doesn't work. Any ideas?
I am trying to access a file that has a variable in its name (i.e. file_n: file_1, file_2, etc). I am trying to access it with
cat $file_$n
But this doesn't work. Any ideas?
Remove $
from file, use cat file_$n
instead to view the content of the file.