diff options
Diffstat (limited to 'scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh')
-rw-r--r-- | scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh b/scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh index 8d05fa5..0de3ce2 100644 --- a/scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh +++ b/scripts/hedgedoc-ldap_to_oauth2/ldap_users.sh @@ -1,8 +1,8 @@ #!/bin/bash -while read p; do - USER=`echo $p | sed 's/\s.*$//'` - ID=`echo $p | sed 's/.* //'` - echo $USER $ID - sed 's/$UID/'$USER'/g' replacements.txt | sed 's/$LDAPID/'$ID'/g' - >> replacements.sql +while read -r p; do + USER=$(echo "$p" | sed 's/\s.*$//') + ID=$(echo "$p" | sed 's/.* //') + echo "$USER" "$ID" + sed "s/\$UID/$USER/g" replacements.txt | sed "s/\$LDAPID/$ID/g" - >>replacements.sql done <ldap_users.txt |