diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-12-31 13:53:41 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-12-31 13:53:41 +0800 |
commit | d43731dd58bde728a6751b30db6c754140d5aadc (patch) | |
tree | fb47f5ec900cc9fcdb57dd8afed2eaf779d0cbef /bin | |
parent | d7e7f869431122b50b0d98b41b6c93a831226154 (diff) |
update syntax in comment.sh
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mail/comment.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/mail/comment.sh b/bin/mail/comment.sh index 20ecb1e..d363886 100755 --- a/bin/mail/comment.sh +++ b/bin/mail/comment.sh | |||
@@ -76,10 +76,10 @@ shopt -s lastpipe; set +m; | |||
76 | 76 | ||
77 | # save each field of header into variables | 77 | # save each field of header into variables |
78 | echo "$header" | \ | 78 | echo "$header" | \ |
79 | while read field value; do | 79 | while IFS=: read field value; do |
80 | echo "$field" "$value" >>/tmp/header | 80 | field="${field^^}" |
81 | declare field=$(<<<$field tr [:lower:] [:upper:] | tr '-' '_' | tr -d ':') | 81 | field="${field//-/_}" |
82 | declare $field="${value}" | 82 | export declare $field="${value}" |
83 | done | 83 | done |
84 | DATE=${DATE:+$(date --rfc-3339 seconds --date "$DATE")} | 84 | DATE=${DATE:+$(date --rfc-3339 seconds --date "$DATE")} |
85 | 85 | ||