I am trying to get a sed
command which will help me with the output which will display just the 2 words & not more than that.
echo "test1:pass,test2:fail,test3:pass,test4:pass,test5:pass,test6:pass asfas" | sed 's/,/<br>/g; s/:/ # /g; s/\b\(.\)/\u\1/g'
Expected output :
Test1 # Pass
Test2 # Fail
Test3 # Pass
Test4 # Pass
Test5 # Pass
Test6 # Pass
I don't want the asfas to be present in the last Test6 line.
Also, I just want that the result should be either Pass or Fail, nothing else should come like PAss or PaSS
Whatever is there in echo
command either PaSS
or PAss
or FaIl
or FAil
, it should get replaced with either Pass or Fail only. Any word which is mentioned after the Pass or Fail should get removed and needs not to be shown.
Can someone tell me the more cleaner way to achieve the requirement from what I wrote ?
Thanks :)