How to remove new line from output

/usr/bin/ldapsearch -h #{internal_it_AD_ipaddress} -p 389 -D
“cn=LDAP n xxxxxxxxx” -x -b “CN=DL LDAP xxxxxxxx” -s sub
“(objectClass=*)” -w ‘#{internal_it_AD_password}’ –LLL

when it shows output but breaks the lines ( long lines)
symptoms are :
http://www.novell.com/communities/node/12117/output-large-attribute-values-ldap-search-single-line

there is a solution like this by using perl :
perl -p00e ‘s/\r?\n //g’

/usr/bin/ldapsearch -h #{internal_it_AD_ipaddress} -p 389 -D
“cn=LDAP n xxxxxxxxx” -x -b “CN=DL LDAP xxxxxxxx” -s sub
“(objectClass=*)” -w ‘#{internal_it_AD_password}’ –LLL | perl -p00e
‘s/\r?\n //g’

Just wanted to know is there any equivalent in ruby (ruby one liner )
??

Thanks

On Wed, Sep 25, 2013 at 1:34 PM, Fosiul A. [email protected]
wrote:

perl -p00e ‘s/\r?\n //g’

Just wanted to know is there any equivalent in ruby (ruby one liner )
??

$ echo -e ‘foo\n bar’ | perl -p00e ‘s/\r?\n //g’
foobar
$ echo -e ‘foo\n bar’ | ruby -p00e ‘gsub /\r?\n /, “”’
foobar

robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs