From: Stephen Rothwell Date: Wed, 30 Sep 2020 11:42:21 +0000 (+1000) Subject: send_email: tidy up X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=122af73ed70c3e808292e2921f2a4316cc15282c;p=next-scripts send_email: tidy up --- diff --git a/send_email b/send_email index 60842a7..9930ad2 100755 --- a/send_email +++ b/send_email @@ -1,12 +1,13 @@ #!/bin/bash -TARGET="$(realpath --relative-to=. $(dirname $0)/../mails)"/$(date +"%Y-%m-%d+%s").email +mail_dir=$(realpath --relative-to=. "$(dirname "$0")/../mails") +printf -v TARGET '%s/%(i%Y-%m-%d+%s)T.email' "$mail_dir" -1 to="$1" cc="$2" subject="$3" -( +{ cat < $TARGET +} > "$TARGET" -gvim $TARGET +gvim "$TARGET" -echo "When you're finished editing you need to send $TARGET" +printf 'When you are finished editing you need to send %s\n' "$TARGET" exit 0