|
Using a variable inside a file to cat another.
I have a question to do and it's somewhat confusing. It says, and I quote
"Create a file called file_1 with three lines of text in it. Create a shell variable called "f_name", assign it the string "file_1". Use the cat command and the variable "f_name" to display the contents of the file "file_1""
Now what I did was I made both files, and in "f_name" I wrote this.
#!/bin/sh
f_name="file_1"
cat $f_name
and this will work. However what I think is the professor wants me to use this shell scripts f_name variable in a cat command without having the script itself do the work.
Is there a way to do this?
|