Hi.
I have a data file, which contains one line. It is a filename. I want awk to read this out from the file and make an other file, which has the name the previous one contains. How could I make this?
Example:
filename: xy.dat
it contains: abc.fits
So awk should read this and make a file named: abc.fits
How can I do this? I tried it with the built-in variable: FILENAME but it didn't work.Thanks!
Why do you insist on using awk? A simple touch command will create the file: #!/bin/bash
touch $(< xy.dat)
But if you insist:
#!/bin/bash
awk ' { print "" >> $0 } ' xy.dat
Thank You! After a few hours I posted the question, I found the 'touch' command... I'm only a beginner.
You can also use the cat command to achieve this. #!/bin/sh
filename=$(cat xy.dat)