25 Jul
2012
25 Jul
'12
4:44 p.m.
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-v...
Ed W