aboutsummaryrefslogtreecommitdiff
path: root/otp.bash
diff options
context:
space:
mode:
authorRemus Buzatu <r.buzatu90@gmail.com>2018-06-28 03:20:59 +0300
committerTad Fisher <tadfisher@gmail.com>2018-06-28 09:44:59 -0700
commite5642a873b41790b3e18c427d54df5831f355ae2 (patch)
tree6edde9e73b05058a52ed2a1cc3e4321261fa1079 /otp.bash
parent955c8a104b3bda5d501104985f50fbdc607bc104 (diff)
Don't use herestrings
Diffstat (limited to 'otp.bash')
-rwxr-xr-xotp.bash12
1 files changed, 6 insertions, 6 deletions
diff --git a/otp.bash b/otp.bash
index 72e3aa2..2668d9a 100755
--- a/otp.bash
+++ b/otp.bash
@@ -61,7 +61,7 @@ otp_parse_uri() {
local p=${BASH_REMATCH[7]}
local params
- local IFS=\&; read -r -a params <<< "$p"; unset IFS
+ local IFS=\&; read -r -a params < <(echo "$p") ; unset IFS
pattern='^(.+)=(.+)$'
for param in "${params[@]}"; do
@@ -138,7 +138,7 @@ otp_insert() {
mkdir -p -v "$PREFIX/$(dirname "$path")"
set_gpg_recipients "$(dirname "$path")"
- $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" <<<"$contents" || die "OTP secret encryption aborted."
+ echo "$contents" | $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" || die "OTP secret encryption aborted."
git_add_file "$passfile" "$message"
}
@@ -289,7 +289,7 @@ cmd_otp_append() {
[[ "$line" == otpauth://* ]] && line="$otp_uri"
[[ -n "$replaced" ]] && replaced+=$'\n'
replaced+="$line"
- done <<< "$contents"
+ done < <(echo "$contents")
else
replaced="$contents"$'\n'"$otp_uri"
fi
@@ -329,7 +329,7 @@ cmd_otp_code() {
otp_parse_uri "$line"
break
fi
- done <<< "$contents"
+ done < <(echo "$contents")
local cmd
case "$otp_type" in
@@ -362,7 +362,7 @@ cmd_otp_code() {
[[ "$line" == otpauth://* ]] && line="$uri"
[[ -n "$replaced" ]] && replaced+=$'\n'
replaced+="$line"
- done <<< "$contents"
+ done < <(echo "$contents")
otp_insert "$path" "$passfile" "$replaced" "Increment HOTP counter for $path."
fi
@@ -398,7 +398,7 @@ cmd_otp_uri() {
otp_parse_uri "$line"
break
fi
- done <<< "$contents"
+ done < <(echo "$contents")
if [[ $clip -eq 1 ]]; then
clip "$otp_uri" "OTP key URI for $path"