From 82557b7196ad818c0324d6140bab3d53701705bc Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 2 Jun 2021 19:35:34 +0200 Subject: [PATCH] Fix problem with some passwords and login names --- .gitignore | 1 + convert_to_csv.sh | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index afed073..41621ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.csv +*.kdbx diff --git a/convert_to_csv.sh b/convert_to_csv.sh index 89fba66..c9ede98 100755 --- a/convert_to_csv.sh +++ b/convert_to_csv.sh @@ -31,12 +31,11 @@ if [[ -f "$FINAL_FILE_NAME" ]]; then GPG_FILE_NAME=${GPG_FILE_NAME/\.gpg/} PASSWORD=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | head -n1) - PASSWORD=${PASSWORD/\"/\\\"} - LOGIN_KEY=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | awk '/login/ || /ID/ || /email/ {print $2}') + LOGIN_KEY=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | awk '/^login:|ID:|email:|user:/ {ORS=" ";for(i=2; i<=NF; i++) print $i; exit;}') GPG_FILE_NAME=${GPG_FILE_NAME//\// > } - echo "Processing ${GPG_FILE_NAME}"; + echo "Processing $GPG_FILE_NAME"; echo "$GPG_FILE_NAME$DELIMITER$PASSWORD$DELIMITER$LOGIN_KEY" >> $FINAL_FILE_NAME }; done; unset f;