diff options
| author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-11-04 16:37:44 +0000 |
|---|---|---|
| committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-11-04 16:37:44 +0000 |
| commit | 0d374a5f82b88177d2fdaf35d9c28080a8f35494 (patch) | |
| tree | 88f4e7c97f48884080d07d64936e180fbd493a0c /Scripts/.local/scripts/status/temperature | |
| parent | 0f667e4d76857f582048a6560320c5515749242d (diff) | |
| download | dotfiles-0d374a5f82b88177d2fdaf35d9c28080a8f35494.tar.gz dotfiles-0d374a5f82b88177d2fdaf35d9c28080a8f35494.tar.bz2 dotfiles-0d374a5f82b88177d2fdaf35d9c28080a8f35494.zip | |
awk refactor of my scripts
awk is OP man - so easy to use and does a bunch of stuff all at once
without having to rely on multiple pipes. It comes with essentially
every distribution so you'll always have access to it.
Diffstat (limited to 'Scripts/.local/scripts/status/temperature')
| -rwxr-xr-x | Scripts/.local/scripts/status/temperature | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Scripts/.local/scripts/status/temperature b/Scripts/.local/scripts/status/temperature index 1a6f5dd..b81fe9e 100755 --- a/Scripts/.local/scripts/status/temperature +++ b/Scripts/.local/scripts/status/temperature @@ -1,3 +1,4 @@ #!/usr/bin/env sh -echo "㊋ $(sensors | grep "Tctl" | sed 's/Tctl:.*+\(.*\)C.*/\1/')C" +data=$(sensors | awk -F'+' '/Tctl/ { gsub(/[ \t]+$/, "", $2); print $2 }') +echo "㊋ $data" |
