linux - .bash_profile ldapsearch function not outputting to terminal -
this question has answer here:
i have bash function in .bash_profile not returning results terminal. when run command normal via cli results returned.
ldap_check_cleaup () { ldapsearch -lll -h itdsvbms.somedomain.org -p 389 \ -d "uid=someuser,o=somedomain.org" -w somepassword -b "ou=people,o=somedomain.org" \ -s sub '(&(reservedrmaliases=$1)(!(rmid=*))(rmaliasupdatedate=12/01/2012 19:02:00)(rmaliasstatus=in)(status=in))' | \ tee /dev/tty }
running ldap_check_clenaup testrecord returns no output when executed bash prompt. testrecord exist , when following command run cli, correct record returned:
ldapsearch -lll -h itdsvbms.somedomain.org -p 389 -d "uid=someuser,o=somedomain.org" \ -w somepassword -b "ou=people,o=somedomain.org" \ -s sub '(&(reservedrmaliases=testrecord)(!(rmid=***))(rmaliasupdatedate=12/01/2012 19:02:00)(rmaliasstatus=in)(status=in))' | \ tee /dev/tty`
the lack of out put happens when try use ldapsearch , arguments bash function.
i think may related using ' instead of " attribute (!(rmid=*)) unsure, please help.
you need use double-quotes around argument contains $1
. variable interpolation not performed inside single-quoted strings.
Comments
Post a Comment