I am trying to remove the new line character for a date function and have it include spaces. I am saving the variables using this:
current_date=$(date "+%m/%d/%y AT %H:%M:%S" )
I need the date to stay in the current line of text and continue with no newline unless specified.
current_date=$(date "+%m/%d/%y AT %H:%M:%S" )
awk '(++n==2) {print "1\nData \nAccount '$current_date' Terminated; n=0} (/blah/) {n=0} {print}' input file > output file
Input:
Line 1
Line 2
Line 3
Output:
Line 1
Line 2
Data
Account '$current_date'
Terminated
Line 3
Desired Output:
Line 1
Line 2
Data
Account '$current_date' Terminated
Line 3