in reply to Readable ldapsearch output

THANK YOU ! I added your magic to my .bashrc: alias ldapdecode="perl -MMIME::Base64 -n -00 -e 's/\n //g;s/(?<=:: )(\S+)/decode_base64(\$1)/eg;print'" and just do ldapsearch | ldapdecode Again, Thank you A LOT !!

Replies are listed 'Best First'.
Re^2: Readable ldapsearch output
by Anonymous Monk on Aug 13, 2016 at 18:32 UTC
    I'm getting the following error:
    ./getDN.sh: line 4: syntax error near unexpected token `?' ./getDN.sh: line 4: `ldapsearch -h platform-vip -p 7323 -D "administra +torName=jambala, nodeName=jambala" -w -b "$1" "(objectClass=*)" -x - +P 3 -s sub | perl -MMIME::Base64 -n -00 -e 's/\n //g;s/(?<=:: )(\S+) +/decode_base64($1)/eg;print''
    here is my perl version:
    This is perl, v5.10.0 built for x86_64-linux-thread-multi

    Any advice?

      Any advice?

      Forget about oneliners, write programs, much easier to read and debug