diff options
Diffstat (limited to 'src/content/tils/2021/01')
-rw-r--r-- | src/content/tils/2021/01/12/curl-awk-emails.adoc | 8 | ||||
-rw-r--r-- | src/content/tils/2021/01/17/posix-shebang.adoc | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/content/tils/2021/01/12/curl-awk-emails.adoc b/src/content/tils/2021/01/12/curl-awk-emails.adoc index 875c655..d432da2 100644 --- a/src/content/tils/2021/01/12/curl-awk-emails.adoc +++ b/src/content/tils/2021/01/12/curl-awk-emails.adoc @@ -18,7 +18,7 @@ write a solution. The first part was the easiest: store the email in a file: -[source,shell] +[source,sh] ---- # ~/.config/mutt/muttrc: set sendmail=~/bin/enqueue-email.sh @@ -32,7 +32,7 @@ cat - > "$HOME/mbsync/my-queued-emails/$(date -Is)" Now that I had the email file store locally, I needed a program to send the email from the file, so that I could create a cronjob like: -[source,shell] +[source,sh] ---- for f in ~/mbsync/my-queued-emails/*; do ~/bin/dispatch-email.sh "$f" && rm "$f" @@ -43,7 +43,7 @@ The `dispatch-email.sh` would have to look at the `From:` header and decide which SMTP server to use. As I {found-out-article}[found out] that {curl}[curl] supports SMTP and is able to send emails, this is what I ended up with: -[source,shell] +[source,sh] ---- #!/bin/sh -eu @@ -102,7 +102,7 @@ array. I even did it incrementally: -[source,shell] +[source,sh] ---- $ H='To: to@example.com, to2@example.com\nCc: cc@example.com, cc2@example.com\nBcc: bcc@example.com,bcc2@example.com\n' $ printf "$H" | awk '/^To: .*$/ { print $0 }' diff --git a/src/content/tils/2021/01/17/posix-shebang.adoc b/src/content/tils/2021/01/17/posix-shebang.adoc index 4e2fbe8..5cf0695 100644 --- a/src/content/tils/2021/01/17/posix-shebang.adoc +++ b/src/content/tils/2021/01/17/posix-shebang.adoc @@ -14,7 +14,7 @@ I didn't know what to do with that first line. What I had previously was: -[source,shell] +[source,sh] ---- #!/usr/bin/env bash set -Eeuo pipefail @@ -27,7 +27,7 @@ options were also gone, and would be replaced by nothing. I converted all of them to: -[source,shell] +[source,sh] ---- #!/bin/sh -eu ---- @@ -45,7 +45,7 @@ options is ignored, as it is a comment! Which means that the shebang most friendly with POSIX is: -[source,shell] +[source,sh] ---- #!/bin/sh set -eu |