in reply to Take the input from command line and have output redirected to a file?

By opening STDOUT in that manner, you have told it to direct output to that file, output_cal_date.txt, but only while it is open. Close it only after you have printed what you want to print.

Dum Spiro Spero
  • Comment on Re: Take the input from command line and have output redirected to a file?