0

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?

Mike Laren
  • 8,028
  • 17
  • 51
  • 70

1 Answers1

1

Remove $ from file, use cat file_$n instead to view the content of the file.

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
  • @WillMcConnell- If this answer helps, please don't forget to accept the answer. See how to accept the answer ---> http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Am_I_Helpful Jul 12 '15 at 19:00