[LEFT]I need to print the lines that do not match a pattern. I tried using grep -v and sed -n '/pattern/!p', but both of them are not working as I am passing the pattern as variable and it can be null some times.
Thank you for the quick reply, this option would not work as the structure of the line is different, as below.
For other purposes, in the whole script, I am extracting the value in the brackets and assigning it to a variable. The value in the brackets is alpha numeric with "-" in between ex: abcd[xyz12-45de-5678se].
I am extracting the value based on a condition. so sometimes it can be null. In that case, the grep will look like grep -v ' '