Hi I have a shell command like this.
s3=$(awk \'BEGIN{ print \"S3 bucket path\" }
/Executing command\\(queryId/{ sub(/.*queryId=[^[:space:]]+: /,\"\"); q=$0 }
Hi you can do it just by adding echo $s3 | sed '$!d'
s3=$(awk 'BEGIN{ print "S3 bucket path" }/Executing command\(queryId/{ sub(/.*queryId=[^[:space:]]+: /,""); q=$0 } /s3:\/\//{ print "," $10 }' OFS=',' hive-server2.log)
echo $s3 | sed '$!d'
It will simply print:-
2018-02-21T18:05:34
Hope this will help you.