I want to replace in this string Wed Apr 10 06:44:10 UTC 2019 all whitespaces with comma and along with that trim off UTC part.
What I have tried :
var1="Wed Apr 10 06:44:10 UTC 2019" echo ${var// /,} This gives all spaces removed but how to trim off UTC part, I want to achieve this in one line command.