When you read the file line by line the end of line character is included in the result<br><br>try user[:-1] instead to strip the return from your printed text<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 11, 2012 at 5:31 PM, Mike <span dir="ltr"><<a href="mailto:miguelcoam@gmail.com" target="_blank">miguelcoam@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I am learning python and i have the next problem and i not understand how fix.<br>
The script is very simple, shows in the terminal the command but, the row is divided in two:<br>
Example:<br>
<br>
<br>
/opt/zimbra/bin/zmprov ga <a href="mailto:user@example.com">user@example.com</a><br>
|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"<br>
/opt/zimbra/bin/zmprov ga <a href="mailto:user2@example.com">user2@example.com</a><br>
|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"<br>
<br>
And the correct is:<br>
/opt/zimbra/bin/zmprov ga <a href="mailto:user@example.com">user@example.com</a> |egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"<br>
<br>
<br>
The script is:<br>
<br>
#!/usr/bin/python<br>
import os<br>
<br>
for user in open ("email"):<br>
        print '/opt/zimbra/bin/zmprov ga ' + user + '|egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)" '<br>
<br>
<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Joel Goldstick<br><br>
</div>