summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-19 20:37:38 -0500
committerJune McEnroe <june@causal.agency>2021-02-19 20:37:38 -0500
commit3bb8536241fe717c35ac87b44dc2c5ab9cbd3236 (patch)
tree040511d955ae9c08f3d36af69e733ca590eb8bf7 /home
parentAdd Network Effect (diff)
downloadsrc-3bb8536241fe717c35ac87b44dc2c5ab9cbd3236.tar.gz
src-3bb8536241fe717c35ac87b44dc2c5ab9cbd3236.zip
Handle negative inputs to deg
Diffstat (limited to 'home')
-rwxr-xr-xhome/.local/bin/deg4
1 files changed, 2 insertions, 2 deletions
diff --git a/home/.local/bin/deg b/home/.local/bin/deg
index e1781300..216029ed 100755
--- a/home/.local/bin/deg
+++ b/home/.local/bin/deg
@@ -1,6 +1,6 @@
 #!/bin/sh
 set -eu
 cat <<EOF
-${1}°F = $(dc -e "1k ${1} 32-1.8/p")°C
-${1}°C = $(dc -e "1k ${1} 1.8*32+p")°F
+${1}°F = $(dc -e "1k $(echo "$1" | sed 's/^-/_/') 32-1.8/p")°C
+${1}°C = $(dc -e "1k $(echo "$1" | sed 's/^-/_/') 1.8*32+p")°F
 EOF