Moved the ugly awk scipt to a separate file
Better formatting and moved FS to the awk script
shortening path string only if it gets actually shorter