[Dovecot] Remove leading and trailing spaces from folder names?

Ed W lists at wildgooses.com
Wed Jul 25 16:44:34 EEST 2012


On 25/07/2012 11:59, Timo Sirainen wrote:
> On 25.7.2012, at 13.54, Ralf Hildebrandt wrote:
>
>>> The way I'd do this is to just do doveadm mailbox list, put the strings
>>> through some regexps and doveadm rename if necessary. Repeat for all
>>> users.
>> Yes, something along those lines. It's just that I find it hard to
>> craft a regexp which does that. Maybe after the vacation.
> echo "  foo/  b a r  /  baz  / sup  " | perl -pe 's, +/,/,g; s,/ +,/,g; s/^ +//; s/ +$//'
>

Bet you can't pronounce all of the above

;-)

Stack overflow on doing it in bash (probably would use the perl regexp 
above though, but only because I understand perl regexps better)

http://stackoverflow.com/questions/369758/how-to-trim-whitespace-from-bash-variable

Ed W



More information about the dovecot mailing list