awk can do all of the string maniuplations that
sed can do, so just do it all in
awk.
Code:
awk -F':' '{print "Variable "$1 " has Location " $2 " version of " gensub(".*/", "", 1, $2)}' file.log
That also avoids the "useless use of
cat".
Yes,
gensub() is a GNU extension. If you're using some other version of
awk, please specify.