I have a script that concatenates output from two different variables. The issue is that the output of both variables contains multiple rows. So, the output isn't what I expect.
First variable and output:
snap_daily=`cat snaps.txt | grep test-for-dr | awk '{print $2}' | sed 's/[",]//g' | sed 's/test-for-dr-//g'` 2017-03-10-08-00 2017-03-10-11-00 2017-03-10-12-00 2017-03-10-14-00 2017-03-10-15-00
Second variable and output:
snap_prefix=`cat snaps.txt | grep test-for-dr | awk '{print $2}' | sed 's/[",]//g' | awk -F '2017' '{print $1}' test-for-dr- test-for-dr- test-for-dr- test-for-dr- test-for-dr-
Code to concatenate and result:
snap_name="$snap_prefix$snap_daily" test-for-dr-bdmprest- test-for-dr-bdmprest- test-for-dr-bdmprest- test-for-dr-bdmprest- test-for-dr-bdmprest-2017-03-10-08-00 2017-03-10-11-00 2017-03-10-12-00 2017-03-10-14-00 2017-03-10-15-00
Desired Result:
test-for-dr-2017-03-10-08-00 test-for-dr-2017-03-10-11-00 test-for-dr-2017-03-10-12-00 test-for-dr-2017-03-10-14-00 test-for-dr-2017-03-10-15-00
Essentially, I need each line to match from each respective line of output.