I have a very simple ksh script and at certain points I want to write to a log file. I use the following commands in two places...
print "Directory listing 1:\n" > ${LogFile}
ll >> ${LogFile}
(Note: The second time this command is used print Directory listing 2)
My problem is, when I view the log file afterwards, only the second execution of these commands work! So there's no "Directory listing 1" and accompanying "ll" output.
I have tested and tested the script to ensure that there's nothing wrong my logic. I've added print test commands just before each so I know they get executed.
Is there something I've done wrong or I'm not realising?
