This is the command what i run.
ldap="$(ldapwhoami -x -H ldap://ABC.example.org -D "$user" -w "$pass")"
This is the output result:
u:ABC\1234567
May i know how to get the expected output ? like this 1234567
Thanks
This is the command what i run.
ldap="$(ldapwhoami -x -H ldap://ABC.example.org -D "$user" -w "$pass")"
This is the output result:
u:ABC\1234567
May i know how to get the expected output ? like this 1234567
Thanks
1st Solution: Could you please try following.
echo "u:ABC\1234567" | awk -F'\' '{print $NF}'
OR
your_command | awk -F'\' '{print $NF}'
2nd solution: using awk
's sub
method.
your_command | awk '{sub(/.*\\/,"")} 1'