File 2 should not be generated if File1 is not available

I am using "awk -f file1 > file2" , its generating file2 even if there is no file1.
I am looking for file2 only if file1 is available. If there is no file1, then file2 should not generate.

how about checking if file1 exists prior to invoking awk?
Should be straight forward in any shell...

1 Like

Hi @vgersh99, It worked, I added File Check prior to awk.
Thanks for solution.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.