Sat, 12 Aug 2006, by twe-suse.e@ferrets4me.xs4all.nl:
Sat, 12 Aug 2006, by dylan@dylan.me.uk:
Hi All,
I'm working on a script which extracts the tags from ogg and mp3 files and distributes the files in a directory structure according to the tag contents.
I've found that some files have tags with excess whitespace at the end. What methods are there for removing this whitespace in a bash script?
No need for a script, just a simpel use of Bash built-in capabilities.
$ file="test file 1" $ echo ${file// /} testfile1
Zie bash(1); Parameter Expansion
Forgot to mention: if you only want the trailing spaces removed, use this form: ${file//% /} Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.