Using bash string replace instead of sed

Co-authored-by: Jonathan Harker