From 314b3795def497eb1cf4b5c3e975ce029585db3d Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 17 Mar 2021 11:38:47 +0100 Subject: [PATCH 1/2] Fixed conversion for password with escape character using TAB delimiter --- convert_to_csv.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/convert_to_csv.sh b/convert_to_csv.sh index a8d34b9..89fba66 100755 --- a/convert_to_csv.sh +++ b/convert_to_csv.sh @@ -15,13 +15,14 @@ fi BASE_NAME=passwords CURRENT_DATE=$(date "+%Y-%m-%d") FINAL_FILE_NAME=${BASE_NAME}_${CURRENT_DATE}.csv +DELIMITER=$'\t' if [[ -f "$FINAL_FILE_NAME" ]]; then echo "A file with name $FINAL_FILE_NAME already exists! Please rename or delete and re-execute this script." exit else touch $FINAL_FILE_NAME - echo "\"Account\";\"Password\";\"Login\"" >> $FINAL_FILE_NAME + echo "Account${DELIMITER}Password${DELIMITER}Login" >> $FINAL_FILE_NAME fi if [[ -f "$FINAL_FILE_NAME" ]]; then @@ -36,7 +37,7 @@ if [[ -f "$FINAL_FILE_NAME" ]]; then GPG_FILE_NAME=${GPG_FILE_NAME//\// > } echo "Processing ${GPG_FILE_NAME}"; - echo "\"$GPG_FILE_NAME\";\"$PASSWORD\";\"$LOGIN_KEY\"" >> $FINAL_FILE_NAME + echo "$GPG_FILE_NAME$DELIMITER$PASSWORD$DELIMITER$LOGIN_KEY" >> $FINAL_FILE_NAME }; done; unset f; From c984e729013be7c51b780b13fccfd6f2aed28624 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 17 Mar 2021 11:41:55 +0100 Subject: [PATCH 2/2] Updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b34b019..50a076d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains some scripts that aims to convert a gpg password wallet ## Usage ### convert_to_csv.sh -Simply execute the script. You need `pass` executable installed and ENV var PASSWORD_STORE_DIR set-up. A CSV file will be created in this folder containing key-password fields separated by semicolon and delimited by `"`. +Simply execute the script. You need `pass` executable installed and ENV var PASSWORD_STORE_DIR set-up. A CSV file will be created in this folder containing key-password fields separated by TAB delimiter. ```bash # Clone this repository