Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-2010, 10:20 AM
Member
 
Posts: 10
Default [SOLVED] Line wrap using zmprov

Hi,

I'm trying to make a bulk change to the Address field of each user in our domain but I can't figure out how to get the line to wrap.

Here is what I have:
Address line1
Suite 222
(blank line 3)

I run the command:
Code:
zmprov -l modifyAccount username@domain.com  street "New Address line 1 New Suite 333"
After I let the LDAP refresh and check the user the address is updated but only one line instead of two like the original address. I've tried some variations but didn't have any luck.

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-24-2010, 10:52 AM
raj raj is offline
Moderator
 
Posts: 768
Default

You can try adding single-quotes with your CR-LF's.

Quote:
zmprov -l modifyAccount username@domain.com street 'Line 1
Line 2
Line 3'
Raj
__________________
i2k2 Networks
Dedicated & Shared Zimbra Hosting Provider
Reply With Quote
  #3 (permalink)  
Old 03-24-2010, 12:21 PM
Member
 
Posts: 10
Default Got it

OK, I found some help on the wiki here. And a little help internally from a linux veteran.

It appears that either zmprov or LDAP doesn't handle the new line character. We tried octal, unicode, etc without luck. The only way it work was to set a variable with \n to break the lines and get echo to interpret the new line and feed it to zmprov

So:
Code:
address="New Address line 1\nNew Suite 333" 
zmprov -l modifyAccount username@domain.com street "`echo -e $address`"
Then check it:
Code:
 zmprov -l getAccount username@domain.com | less
Results in:
New Address line 1
New Suite 333

-
Reply With Quote
  #4 (permalink)  
Old 03-24-2010, 12:55 PM
raj raj is offline
Moderator
 
Posts: 768
Default

did you try what i suggested..it works for me.

you solution is actually doing the same replacing \n with line break..only differnce is SINGLE QUOTE vs DOUBLE QUOTE

Raj
__________________
i2k2 Networks
Dedicated & Shared Zimbra Hosting Provider
Reply With Quote
  #5 (permalink)  
Old 03-24-2010, 01:04 PM
Member
 
Posts: 10
Default

I didn't try it but I appreciate the info. I have quite a few entries and wanted to keep each command on a single line.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.