From 314b3795def497eb1cf4b5c3e975ce029585db3d Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 17 Mar 2021 11:38:47 +0100 Subject: [PATCH] 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;