Results 1 to 5 of 5

Thread: [SOLVED] Line wrap using zmprov

  1. #1
    don.hess is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    5

    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

  2. #2
    raj's Avatar
    raj
    raj is offline Moderator
    Join Date
    Oct 2005
    Location
    USA, Canada and India
    Posts
    777
    Rep Power
    10

    Default

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

    zmprov -l modifyAccount username@domain.com street 'Line 1
    Line 2
    Line 3'
    Raj
    i2k2 Networks
    Dedicated & Shared Zimbra Hosting Provider

  3. #3
    don.hess is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    5

    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

    -

  4. #4
    raj's Avatar
    raj
    raj is offline Moderator
    Join Date
    Oct 2005
    Location
    USA, Canada and India
    Posts
    777
    Rep Power
    10

    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

  5. #5
    don.hess is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    5

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 14
    Last Post: 09-26-2011, 11:50 PM
  2. Moving to different server
    By AaronW1000 in forum Installation
    Replies: 2
    Last Post: 07-03-2008, 07:39 AM
  3. Spam training problem...
    By TaskMaster in forum Installation
    Replies: 2
    Last Post: 05-08-2007, 09:49 AM
  4. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •