From 0d374a5f82b88177d2fdaf35d9c28080a8f35494 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 4 Nov 2025 16:37:44 +0000 Subject: 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. --- Scripts/.local/scripts/status/temperature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Scripts/.local/scripts/status/temperature') 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" -- cgit v1.2.3-13-gbd6f