Problem with print and output to screen

Mike miguelcoam at
Tue Dec 11 23:31:13 CET 2012

Hello, I am learning python and i have the next problem and i not understand how fix.
The script is very simple, shows in the terminal the command but, the row is divided in two:

/opt/zimbra/bin/zmprov ga user at
|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)" 
/opt/zimbra/bin/zmprov ga user2 at
|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"

And the correct is: 
/opt/zimbra/bin/zmprov ga user at |egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"

The script is:

import os

for user in open ("email"):
        print '/opt/zimbra/bin/zmprov ga ' + user + '|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)" '


More information about the Python-list mailing list