pickarooney
December 17th, 2006, 01:07 AM
Can anyone help me with a command to cut a trailing space of a string?
It's for a tagging script that reads filenames in the format singer - songname.mp3, I want to read the two elements into variables. With bash I can just echo the filename and cut into two fields with the - as delimiter, but that leaves me with a trailing and a leading space.
There's probably some awk or sed command that does this.
It's for a tagging script that reads filenames in the format singer - songname.mp3, I want to read the two elements into variables. With bash I can just echo the filename and cut into two fields with the - as delimiter, but that leaves me with a trailing and a leading space.
There's probably some awk or sed command that does this.