btriggs127
Technical User
I think the subject says it all. I have a script that runs a few commands and in the end the AWK script needs a date to go back to in this format YYYY-MM-DD, that has been taken care of thanks to other posts here. The log file then prints out the lines that are >= to the date. That is where I would like to send the out put to STDOUT and append the log file with that info as well. A small example is :
awk 'BEGIN {
printf "Enter the month to go back to: ";getline month < "-"
printf "Enter the day to go back to: "; getline day < "-"
printf "Enter the year to go back to: "; getline year < "-"}
$1 >= year"-"month"-"day {print}' /logfile >> /FINAL LOG FILE
This is where the >> to another log file makes it hang because it waits for input from the FINAL LOG FILE. If it is possible to have it wait for the input from STDIN, but then send the output to append the FINAL LOG FILE, my mission would be complete. Any assistence is greatly appreciated in advance.
Thanks;
-Brian
awk 'BEGIN {
printf "Enter the month to go back to: ";getline month < "-"
printf "Enter the day to go back to: "; getline day < "-"
printf "Enter the year to go back to: "; getline year < "-"}
$1 >= year"-"month"-"day {print}' /logfile >> /FINAL LOG FILE
This is where the >> to another log file makes it hang because it waits for input from the FINAL LOG FILE. If it is possible to have it wait for the input from STDIN, but then send the output to append the FINAL LOG FILE, my mission would be complete. Any assistence is greatly appreciated in advance.
Thanks;
-Brian